function in kernel with zero variables

This is a discussion on function in kernel with zero variables within the Linux Programming forums, part of the Platform Specific Boards category; g'day, I've a question about usage function which can getting zero variable. For example... Code: void input(int buf, int type, ...

  1. #1
    Registered User
    Join Date
    Jan 2009
    Posts
    77

    function in kernel with zero variables

    g'day,
    I've a question about usage function which can getting zero variable.
    For example...
    Code:
    void input(int buf, int type, int class){
    if(type!=....){
    check(buf);
    }
    #ifdef CLASS
    else{
    check(class);
    }
    #endif //CLASS
    }
    // source 1
    int main(){
    int abuf, utype;
    ....
    input(abuf,utype,0);
    }
    // source 2 specify for usage same CLASS
    int main(){
    int abuf, utype, xclass;
    ....
    input(abuf,utype,xclass);
    }
    Tell me please, its would be correct or not?
    I needs to do this in linux kernel, therefore I posted my topic in linux thread.

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Huh? Can you rephrase your question in some way, because I can't make much sense of what you've written.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. In over my head
    By Shelnutt2 in forum C Programming
    Replies: 1
    Last Post: 07-08-2008, 07:54 PM
  2. Game Pointer Trouble?
    By Drahcir in forum C Programming
    Replies: 8
    Last Post: 02-04-2006, 02:53 AM
  3. <Gulp>
    By kryptkat in forum Windows Programming
    Replies: 7
    Last Post: 01-14-2006, 01:03 PM
  4. Question..
    By pode in forum Windows Programming
    Replies: 12
    Last Post: 12-19-2004, 07:05 PM
  5. Interface Question
    By smog890 in forum C Programming
    Replies: 11
    Last Post: 06-03-2002, 06:06 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21