From: Sarvi Shanmugham <sarvil...@gmail.com>
Date: Fri, 28 Sep 2012 09:07:24 -0700 (PDT)
Local: Fri, Sep 28 2012 12:07 pm
Subject: A couple of enum and type questions
1. I have an enum as follows } my_thread_sched_mode; This generates code as int _cffi_e_enum_my_thread_sched_mode_(char *out_error) { if (MY_THREAD_MODE_NORMAL != 0) { snprintf(out_error, 255, "in enum %s: %s has the real value %d, not %d", "my_thread_sched_mode_", "MY_THREAD_MODE_NORMAL", (int)MY_THREAD_MODE_NORMAL, 0); return -1; } if (MY_THREAD_MODE_NON_PREEMPTIVE != 4294967295) { snprintf(out_error, 255, "in enum %s: %s has the real value %d, not %d", "my_thread_sched_mode_", "MY_THREAD_MODE_NON_PREEMPTIVE", (int)MY_THREAD_MODE_NON_PREEMPTIVE, 4294967295); return -1; } return 0; } The second snprintf causes a warning __pycache__/_cffi__g644663dbx82c763c2.c:910: warning: this decimal constant is unsigned only in ISO C90 __pycache__/_cffi__g644663dbx82c763c2.c:912: warning: this decimal constant is unsigned only in ISO C90 __pycache__/_cffi__g644663dbx82c763c2.c:912: warning: format '%d' expects type 'int', but argument 7 has type 'long unsigned int' __pycache__/_cffi__g644663dbx82c763c2.c:912: warning: format '%d' expects type 'int', but argument 7 has type 'long unsigned int' I am guessing this is caused by the 0xffffffff 2. There is warnings such as for code generated as follows } From cdef as follows typedef void (*my_dm_exec_handler)(my_dm_handle xdm, intptr_t data, uint64 modifier); int my_dm_execute(my_dm_handle xdm, my_dm_exec_handler h, intptr_t data, uint64 modifier); I can see that this has something to do with the way intptr_t and uint64 is My question: What is the easy way to figure out what the right type should You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||