[Redbutton-devel] SF.net SVN: redbutton:[511] redbutton-browser/trunk/xsd2c.c
Brought to you by:
skilvington
|
From: <ski...@us...> - 2008-12-12 09:25:37
|
Revision: 511
http://redbutton.svn.sourceforge.net/redbutton/?rev=511&view=rev
Author: skilvington
Date: 2008-12-12 09:25:29 +0000 (Fri, 12 Dec 2008)
Log Message:
-----------
fix remaining gcc 4 pointer target sign warnings
Modified Paths:
--------------
redbutton-browser/trunk/xsd2c.c
Modified: redbutton-browser/trunk/xsd2c.c
===================================================================
--- redbutton-browser/trunk/xsd2c.c 2008-12-12 09:24:43 UTC (rev 510)
+++ redbutton-browser/trunk/xsd2c.c 2008-12-12 09:25:29 UTC (rev 511)
@@ -8,7 +8,11 @@
* -c gives the output C source file (default is <ASN1-types>.c)
* -h gives the output header file (default is <ASN1-types>.h)
*
- * Simon Kilvington, 25/8/2006
+ * Simon Kilvington
+ *
+ * 2006-01-09 - initial release
+ * 2006-08-25 - enum ptrs are not int ptrs on some platforms
+ * 2008-12-11 - stop gcc 4 complaining about unsigned int pointer targets
*/
#include <unistd.h>
@@ -1584,6 +1588,15 @@
void
output_decode_subtype(FILE *src, char *name, char *type, char *ptr, char *len, int indent)
{
+ char cast[1024];
+
+ /* stop gcc 4 complaining about unsigned int pointer targets */
+ if(strcmp(type, "Integer") == 0)
+ {
+ snprintf(cast, sizeof(cast), "(int *) %s", ptr);
+ ptr = cast;
+ }
+
print_indent(src, indent);
fprintf(src, "sublen = der_decode_%s(der, %s, %s);\n", type, ptr, len);
print_indent(src, indent);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|