delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/12/03/00:01:27

From: "John M. Aldrich" <fighteer AT cs DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Pointer to a function & calling this function after...
(VESA LIB)
Date: Wed, 03 Dec 1997 23:31:00 +0000
Organization: Two pounds of chaos and a pinch of salt
Lines: 20
Message-ID: <3485EBB4.3394@cs.com>
References: <199712030318 DOT TAA24651 AT adit DOT ap DOT net>
Reply-To: fighteer AT cs DOT com
NNTP-Posting-Host: ppp220.cs.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Nate Eldredge wrote:
> 
[snip]
> void pix8(int x, int y, int c) { /* ...  */}
> void pix24(int x, int y, int c) { /* ... */ }
> int main(void) /* main() must ALWAYS return int */
> {
>    void (*pix_func)();

Wouldn't void (*pix_func)( int, int, int ); be a better type for this
variable?  Constraining the argument types of function pointers can
prevent all sorts of nasty bugs.

-- 
---------------------------------------------------------------------
|      John M. Aldrich       | "Autocracy is based on the assumption|
|       aka Fighteer I       | that one man is wiser than a million |
|   mailto:fighteer AT cs DOT com   | men.  Let's play that over again,    |
| http://www.cs.com/fighteer | too.  Who decides?"   - Lazarus Long |
---------------------------------------------------------------------

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019