Changeset 586
- Timestamp:
- 08/19/08 15:42:32
- Files:
-
- openpgpsdk/trunk/include/openpgpsdk/util.h (modified) (1 diff)
- openpgpsdk/trunk/util/caster.pl (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
openpgpsdk/trunk/include/openpgpsdk/util.h
r585 r586 55 55 * This is a copy of the macro defined in openssl/asn1.h. 56 56 */ 57 #ifndef CHECKED_PTR_OF(type, p) 58 #define CHECKED_PTR_OF(type, p) \ 59 ((void*) (1 ? p : (type *)0)) 57 #ifndef CHECKED_PTR_OF 58 #define CHECKED_PTR_OF(type, p) ((void*) (1 ? p : (type *)0)) 60 59 #endif 60 #define CHECKED_INSTANCE_OF(type, p) (1 ? p : (type)0) 61 61 #define DECONST(type,p) ((type *)CHECKED_PTR_OF(const type, p)) 62 62 openpgpsdk/trunk/util/caster.pl
r191 r586 37 37 print O "/* (line $lineno) $line */\n"; 38 38 print O "$from;\n"; 39 39 40 print O "#define $tname("; 40 41 print_list($targs,1,1); 41 print O ") (($ttype(*)("; 42 print_list($targs,0); 43 print O "))ops_fcast($fname))("; 44 print_list($fargs,1); 42 print O ") $fname("; 43 print_checked_list($targs, $fargs); 45 44 print O ")\n"; 46 45 … … 92 91 } 93 92 } 93 94 sub print_checked_list { 95 my $types=shift; 96 my $args=shift; 97 98 for(my $n=0 ; $n <= $#$types ; ++$n) { 99 print O ',' if $n; 100 my $type=$types->[$n]->[0]; 101 $type =~ s/^\+//; 102 my $arg=$args->[$n]->[1]; 103 $arg =~ s/^\+//; 104 print O "CHECKED_INSTANCE_OF($type, $arg)"; 105 } 106 }
