Changeset 581
- Timestamp:
- 08/15/08 17:20:06
- Files:
-
- openpgpsdk/trunk/include/openpgpsdk/util.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
openpgpsdk/trunk/include/openpgpsdk/util.h
r570 r581 40 40 41 41 /* typesafe deconstification */ 42 #ifdef OBSOLETE 42 43 #ifdef WIN32 43 44 static void *_deconst(const void *p) … … 47 48 { return (void *)p; } 48 49 #endif 49 #define DECONST(type,p) (((type *(*)(const type *))ops_fcast(_deconst))(p)) 50 #endif /*OBSOLETE*/ 51 52 /* 53 * These macros code ensures that you are casting what you intend to cast. 54 * It works because in "a ? b : c", b and c must have the same type. 55 */ 56 #define CHECKED_PTR_OF(type, p) \ 57 ((void*) (1 ? p : (type *)0)) 58 #define DECONST(type,p) ((type *)CHECKED_PTR_OF(const type, p)) 50 59 51 60 char *ops_str_from_map(int code, ops_map_t *map);
