Hi all,
I got a bit annoyed by all the compiler warnings of tsp so I sat down
and fixed most of them.
I did not fix the compiler warnings on the generated rpc xdr code.
I did not fix one cast from a pointer to an int in
tsp/src/core/ctrl/tsp_group_algo.c:335: warning: assignment makes
pointer from integer without a cast
All the other warnings I fixed.
Most of them required a couple of casts from char * to xmlChar * or vice versa.
I used some macro's to make them stand out.
Some other warnings could simply be fixed by changing the type of the
variable to the correct type.
One unused variable.
Two unused functions.
One of them I have placed between #ifdef DEBUG_2D (gdisp_plot2D.c)
And one I decided to call: gdisp_freeSymbolsForSampling() in
gdisp+/gdisp_sampling.c
The companion function gdisp_allocateSymbolsForSampling() was called,
but the other wasn't.
This is the only fix that might not work as it seems that the free
function was only programmed and never actually called since version
1.1 of that file.
If someone thinks this is a good patch, let them commit the patch (or
tell me to do so).
It would be nice if an actual cmake user would remove the -W -Wall
flag for the compilation of the generated code. This would only leave
one warning message. (for erk)
Robert
Index: external/gtk-1.2/gtk/gtkdatabox.c
===================================================================
RCS file: /sources/tsp/tsp/external/gtk-1.2/gtk/gtkdatabox.c,v
retrieving revision 1.1
diff -u -r1.1 gtkdatabox.c
--- external/gtk-1.2/gtk/gtkdatabox.c 21 Feb 2006 21:26:15 -0000 1.1
+++ external/gtk-1.2/gtk/gtkdatabox.c 6 Nov 2007 22:04:20 -0000
@@ -176,7 +176,7 @@
LAST_SIGNAL
};
-static gint gtk_databox_signals[LAST_SIGNAL] = { 0 };
+static guint gtk_databox_signals[LAST_SIGNAL] = { 0 };
guint
gtk_databox_get_type ()
Index: src/consumers/gdisp+/gdisp_configuration.c
===================================================================
RCS file: /sources/tsp/tsp/src/consumers/gdisp+/gdisp_configuration.c,v
retrieving revision 1.17
diff -u -r1.17 gdisp_configuration.c
--- src/consumers/gdisp+/gdisp_configuration.c 26 Apr 2007 17:51:30 -0000 1.17
+++ src/consumers/gdisp+/gdisp_configuration.c 6 Nov 2007 22:04:21 -0000
@@ -62,6 +62,8 @@
--------------------------------------------------------------------
*/
+#define UTF8_TO_CHAR (char*)
+
#define GD_PROVIDER_URL 1
#define GD_PROVIDER_SYMBOLS 2
@@ -755,13 +757,13 @@
SampleList_T *pSampleList = (SampleList_T*)NULL;
guint pSampleMax = 0;
guint sPgi = 1;
- xmlChar *typeBuffer = (xmlChar*)NULL;
- xmlChar indexBuffer [256];
- xmlChar dimensionBuffer [256];
- xmlChar offsetBuffer [256];
- xmlChar nElemBuffer [256];
- xmlChar periodBuffer [256];
- xmlChar phaseBuffer [256];
+ char *typeBuffer = NULL;
+ char indexBuffer [256];
+ char dimensionBuffer [256];
+ char offsetBuffer [256];
+ char nElemBuffer [256];
+ char periodBuffer [256];
+ char phaseBuffer [256];
#define GD_SAMPLE_PGI_AS_STRING_LENGTH 10
gchar samplePGIasStringBuffer[GD_SAMPLE_PGI_AS_STRING_LENGTH];
@@ -1108,7 +1110,7 @@
*/
symbolTableNode = gdisp_xmlGetChildren(document,
providerNode,
- "SampledSymbols/sampledSymbol");
+ BAD_CAST "SampledSymbols/sampledSymbol");
if (symbolTableNode != (xmlNodeSet*)NULL && symbolTableNode->nodeNr > 0) {
@@ -1136,45 +1138,45 @@
cptSymbol++) {
symbolNode = symbolTableNode->nodeTab[cptSymbol];
- symbolIndex = xmlGetProp(symbolNode,"index" );
- symbolName = xmlGetProp(symbolNode,"name" );
- symbolType = xmlGetProp(symbolNode,"type" );
+ symbolIndex = xmlGetProp(symbolNode, BAD_CAST "index" );
+ symbolName = xmlGetProp(symbolNode, BAD_CAST "name" );
+ symbolType = xmlGetProp(symbolNode, BAD_CAST "type" );
if (symbolType == (xmlChar*)NULL) {
- symbolType = gdisp_strDup("F64");
+ symbolType = BAD_CAST gdisp_strDup("F64");
}
- symbolDimension = xmlGetProp(symbolNode,"dim" );
+ symbolDimension = xmlGetProp(symbolNode, BAD_CAST "dim" );
if (symbolDimension == (xmlChar*)NULL) {
- symbolDimension = gdisp_strDup("1");
+ symbolDimension = BAD_CAST gdisp_strDup("1");
}
- symbolOffset = xmlGetProp(symbolNode,"offset");
+ symbolOffset = xmlGetProp(symbolNode, BAD_CAST "offset");
if (symbolOffset == (xmlChar*)NULL) {
- symbolOffset = gdisp_strDup("0");
+ symbolOffset = BAD_CAST gdisp_strDup("0");
}
- symbolNelem = xmlGetProp(symbolNode,"nelem" );
+ symbolNelem = xmlGetProp(symbolNode, BAD_CAST "nelem" );
if (symbolNelem == (xmlChar*)NULL) {
- symbolNelem = gdisp_strDup("0");
+ symbolNelem = BAD_CAST gdisp_strDup("0");
}
- symbolPeriod = xmlGetProp(symbolNode,"period");
+ symbolPeriod = xmlGetProp(symbolNode, BAD_CAST "period");
if (symbolPeriod == (xmlChar*)NULL) {
- symbolPeriod = gdisp_strDup("1");
+ symbolPeriod = BAD_CAST gdisp_strDup("1");
}
- symbolPhase = xmlGetProp(symbolNode,"phase" );
+ symbolPhase = xmlGetProp(symbolNode, BAD_CAST "phase" );
if (symbolPhase == (xmlChar*)NULL) {
- symbolPhase = gdisp_strDup("0");
+ symbolPhase = BAD_CAST gdisp_strDup("0");
}
if (symbolIndex != (xmlChar*)NULL && symbolName != (xmlChar*)NULL) {
- theSymbol->sPgi = gdisp_atoi(symbolIndex,0);
- theSymbol->sInfo.name = gdisp_strDup(symbolName);
+ theSymbol->sPgi = gdisp_atoi(UTF8_TO_CHAR symbolIndex,0);
+ theSymbol->sInfo.name = gdisp_strDup(UTF8_TO_CHAR symbolName);
- theSymbol->sInfo.type = gdisp_getTypeFromString(symbolType);
- theSymbol->sInfo.dimension = gdisp_atoi(symbolDimension,1);
- theSymbol->sInfo.offset = gdisp_atoi(symbolOffset, 0);
+ theSymbol->sInfo.type = gdisp_getTypeFromString(UTF8_TO_CHAR symbolType);
+ theSymbol->sInfo.dimension = gdisp_atoi(UTF8_TO_CHAR symbolDimension,1);
+ theSymbol->sInfo.offset = gdisp_atoi(UTF8_TO_CHAR symbolOffset, 0);
theSymbol->sInfo.nelem =
- gdisp_atoi(symbolNelem,theSymbol->sInfo.dimension);
- theSymbol->sInfo.period = gdisp_atoi(symbolPeriod, 1);
- theSymbol->sInfo.phase = gdisp_atoi(symbolPhase, 0);
+ gdisp_atoi(UTF8_TO_CHAR symbolNelem,theSymbol->sInfo.dimension);
+ theSymbol->sInfo.period = gdisp_atoi(UTF8_TO_CHAR symbolPeriod, 1);
+ theSymbol->sInfo.phase = gdisp_atoi(UTF8_TO_CHAR symbolPhase, 0);
theSymbol->sMinimum = - G_MAXDOUBLE;
theSymbol->sMaximum = + G_MAXDOUBLE;
@@ -1251,7 +1253,7 @@
*/
providerTableNode = gdisp_xmlGetChildren(document,
(xmlNode*)NULL,
- "//Kernel/Provider");
+ BAD_CAST "//Kernel/Provider");
if (providerTableNode != (xmlNodeSet*)NULL &&
providerTableNode->nodeNr > 0) {
@@ -1261,7 +1263,7 @@
cptProvider++) {
providerNode = providerTableNode->nodeTab[cptProvider];
- propertyValue = xmlGetProp(providerNode,"url");
+ propertyValue = xmlGetProp(providerNode, BAD_CAST "url");
switch (infoType) {
@@ -1270,14 +1272,14 @@
/*
* Store the provider url in the kernel.
*/
- gdisp_addUrl(kernel,propertyValue);
+ gdisp_addUrl(kernel, UTF8_TO_CHAR propertyValue);
break;
case GD_PROVIDER_SYMBOLS :
provider = gdisp_getProviderByOriginalUrl(kernel,
- propertyValue /* Url */ );
+ UTF8_TO_CHAR propertyValue /* Url */ );
if (provider != (Provider_T*)NULL) {
@@ -1343,7 +1345,7 @@
*/
symbolTableNode = gdisp_xmlGetChildren(document,
plotNode,
- "sampledSymbol");
+ BAD_CAST "sampledSymbol");
if (symbolTableNode != (xmlNodeSet*)NULL && symbolTableNode->nodeNr > 0) {
@@ -1356,13 +1358,13 @@
/*
* Get back all symbol information : index, zone.
*/
- symbolIndex = xmlGetProp(symbolNode,"index");
- symbolZone = xmlGetProp(symbolNode,"zone");
+ symbolIndex = xmlGetProp(symbolNode, BAD_CAST "index");
+ symbolZone = xmlGetProp(symbolNode, BAD_CAST "zone");
if (symbolIndex != (xmlChar*)NULL) {
symbol = gdisp_getSymbolInConfByIndex(kernel,
- gdisp_atoi(symbolIndex,0));
+ gdisp_atoi(UTF8_TO_CHAR symbolIndex,0));
if (symbol != (Symbol_T*)NULL) {
@@ -1449,7 +1451,7 @@
*/
plotTableNode = gdisp_xmlGetChildren(document,
pageNode,
- "Plot");
+ BAD_CAST "Plot");
if (plotTableNode != (xmlNodeSet*)NULL && plotTableNode->nodeNr > 0) {
@@ -1463,34 +1465,34 @@
* Get back all plot information : type, row, column.
* and create the plot.
*/
- property = xmlGetProp(plotNode,"type");
+ property = xmlGetProp(plotNode, BAD_CAST "type");
if (property != (xmlChar*)NULL) {
plotType = (*kernel->getPlotTypeFromPlotName)(kernel,
(gchar*)property);
xmlFree(property);
}
- property = xmlGetProp(plotNode,"row");
+ property = xmlGetProp(plotNode, BAD_CAST "row");
if (property != (xmlChar*)NULL) {
- plotRow = gdisp_atoi(property,0);
+ plotRow = gdisp_atoi(UTF8_TO_CHAR property,0);
xmlFree(property);
}
- property = xmlGetProp(plotNode,"column");
+ property = xmlGetProp(plotNode, BAD_CAST "column");
if (property != (xmlChar*)NULL) {
- plotColumn = gdisp_atoi(property,0);
+ plotColumn = gdisp_atoi(UTF8_TO_CHAR property,0);
xmlFree(property);
}
- property = xmlGetProp(plotNode,"nbRows");
+ property = xmlGetProp(plotNode, BAD_CAST "nbRows");
if (property != (xmlChar*)NULL) {
- plotNbRows = gdisp_atoi(property,0);
+ plotNbRows = gdisp_atoi(UTF8_TO_CHAR property,0);
xmlFree(property);
}
- property = xmlGetProp(plotNode,"nbColumns");
+ property = xmlGetProp(plotNode, BAD_CAST "nbColumns");
if (property != (xmlChar*)NULL) {
- plotNbColumns = gdisp_atoi(property,0);
+ plotNbColumns = gdisp_atoi(UTF8_TO_CHAR property,0);
xmlFree(property);
}
@@ -1568,7 +1570,7 @@
*/
pageTableNode = gdisp_xmlGetChildren(document,
(xmlNode*)NULL,
- "//Graphics/Page");
+ BAD_CAST "//Graphics/Page");
if (pageTableNode != (xmlNodeSet*)NULL && pageTableNode->nodeNr > 0) {
@@ -1582,16 +1584,16 @@
* Get back all page information : title, rows, columns.
* and create the page.
*/
- pageTitle = xmlGetProp(pageNode,"title");
- pageRows = xmlGetProp(pageNode,"rows");
- pageColumns = xmlGetProp(pageNode,"columns");
+ pageTitle = xmlGetProp(pageNode, BAD_CAST "title");
+ pageRows = xmlGetProp(pageNode, BAD_CAST "rows");
+ pageColumns = xmlGetProp(pageNode, BAD_CAST "columns");
if (pageRows != (xmlChar*)NULL && pageColumns != (xmlChar*)NULL) {
newPage = gdisp_allocateGraphicPage(kernel,
(gchar*)pageTitle,
- gdisp_atoi(pageRows,0),
- gdisp_atoi(pageColumns,0));
+ gdisp_atoi(UTF8_TO_CHAR pageRows,0),
+ gdisp_atoi(UTF8_TO_CHAR pageColumns,0));
/*
* Create all plots of the page.
Index: src/consumers/gdisp+/gdisp_plot2D.c
===================================================================
RCS file: /sources/tsp/tsp/src/consumers/gdisp+/gdisp_plot2D.c,v
retrieving revision 1.24
diff -u -r1.24 gdisp_plot2D.c
--- src/consumers/gdisp+/gdisp_plot2D.c 28 Sep 2006 19:37:54 -0000 1.24
+++ src/consumers/gdisp+/gdisp_plot2D.c 6 Nov 2007 22:04:22 -0000
@@ -92,8 +92,10 @@
gdisp_manageSymbolNameWindow ( Kernel_T *kernel,
Plot2D_T *plot,
GList *symbolList);
+#ifdef DEBUG_2D
static void
gdisp_debugDumpData (char *txt, Plot2D_T *plot);
+#endif
/*
@@ -1677,8 +1679,8 @@
Kernel_T *kernel = (Kernel_T*)data;
Plot2D_T *plot = (Plot2D_T*)NULL;
- guint xPosition = 0;
- guint yPosition = 0;
+ gint xPosition = 0;
+ gint yPosition = 0;
GDISP_TRACE(3,"Motion notify event.\n");
@@ -3068,6 +3070,7 @@
--------------------------------------------------------------------
*/
+#ifdef DEBUG_2D
static void
gdisp_debugDumpData ( char *txt,
Plot2D_T *plot )
@@ -3139,4 +3142,4 @@
fclose (fp);
}
-
+#endif /* DEBUG_2D */
Index: src/consumers/gdisp+/gdisp_preferences.c
===================================================================
RCS file: /sources/tsp/tsp/src/consumers/gdisp+/gdisp_preferences.c,v
retrieving revision 1.8
diff -u -r1.8 gdisp_preferences.c
--- src/consumers/gdisp+/gdisp_preferences.c 21 Sep 2006 20:19:59 -0000 1.8
+++ src/consumers/gdisp+/gdisp_preferences.c 6 Nov 2007 22:04:22 -0000
@@ -79,7 +79,7 @@
* Get back information.
*/
preferenceTableNode =
- gdisp_xmlGetChildren(document,(xmlNode*)NULL,"//Preferences/preference");
+ gdisp_xmlGetChildren(document,(xmlNode*)NULL, BAD_CAST "//Preferences/preference");
if (preferenceTableNode != (xmlNodeSet*)NULL &&
preferenceTableNode->nodeNr > 0) {
@@ -129,7 +129,7 @@
FILE *stream = (FILE*)NULL;
xmlDoc *document = (xmlDoc*)NULL;
- xmlChar completeFilename[256];
+ char completeFilename[256];
/*
@@ -199,11 +199,11 @@
int errorCode = 0;
xmlTextWriterPtr writer = (xmlTextWriterPtr)NULL;
- xmlChar *attributeValue = (xmlChar*)NULL;
+ char *attributeValue = NULL;
xmlChar *tmp = (xmlChar*)NULL;
xmlChar indentBuffer [256];
- xmlChar completeFilename[256];
- xmlChar stringValue [256];
+ char completeFilename[256];
+ char stringValue [256];
/*
* Caution.
@@ -337,7 +337,7 @@
* Path to graphic modules.
*/
attributeValue = kernel->pathToGraphicModules;
- if (attributeValue == (xmlChar*)NULL) {
+ if (attributeValue == NULL) {
attributeValue = "unknown";
}
errorCode = gdisp_xmlWriteAttributes(writer,
Index: src/consumers/gdisp+/gdisp_sampling.c
===================================================================
RCS file: /sources/tsp/tsp/src/consumers/gdisp+/gdisp_sampling.c,v
retrieving revision 1.22
diff -u -r1.22 gdisp_sampling.c
--- src/consumers/gdisp+/gdisp_sampling.c 11 Feb 2007 19:19:25 -0000 1.22
+++ src/consumers/gdisp+/gdisp_sampling.c 6 Nov 2007 22:04:22 -0000
@@ -1063,6 +1063,8 @@
fflush (stdout);
#endif
+ gdisp_freeSymbolsForSampling(kernel);
+
pthread_exit((void*)TRUE);
}
Index: src/consumers/gdisp+/gdisp_symbols.c
===================================================================
RCS file: /sources/tsp/tsp/src/consumers/gdisp+/gdisp_symbols.c,v
retrieving revision 1.12
diff -u -r1.12 gdisp_symbols.c
--- src/consumers/gdisp+/gdisp_symbols.c 5 Aug 2006 20:50:30 -0000 1.12
+++ src/consumers/gdisp+/gdisp_symbols.c 6 Nov 2007 22:04:23 -0000
@@ -478,7 +478,7 @@
gtk_selection_data_set(selectionData,
GDK_SELECTION_TYPE_STRING,
8, /* 8 bits per character */
- action,
+ (guchar*)action,
strlen(action));
}
Index: src/consumers/gdisp+/gdisp_xml.c
===================================================================
RCS file: /sources/tsp/tsp/src/consumers/gdisp+/gdisp_xml.c,v
retrieving revision 1.9
diff -u -r1.9 gdisp_xml.c
--- src/consumers/gdisp+/gdisp_xml.c 26 Apr 2007 17:51:30 -0000 1.9
+++ src/consumers/gdisp+/gdisp_xml.c 6 Nov 2007 22:04:23 -0000
@@ -345,14 +345,14 @@
{
xmlChar spaces[3] = { ' ', ' ', '\0' };
- gint nbSpaces = strlen(spaces);
+ gint nbSpaces = xmlStrlen(spaces);
if (mode == GD_INCREASE_INDENTATION) {
- strcat(indentBuffer,spaces);
+ xmlStrcat(indentBuffer,spaces);
}
else if (mode == GD_DECREASE_INDENTATION) {
- if (strlen(indentBuffer) >= nbSpaces) {
- indentBuffer[strlen(indentBuffer) - nbSpaces] = '\0';
+ if (xmlStrlen(indentBuffer) >= nbSpaces) {
+ indentBuffer[xmlStrlen(indentBuffer) - nbSpaces] = '\0';
}
}
#ifdef XMLWRITER_SUPPORTED
@@ -498,10 +498,10 @@
/*
* Retreive attribute name and value.
*/
- attributeName = (gchar*)attributeList->data;
+ attributeName = attributeList->data;
attributeList = g_list_next(attributeList);
- attributeValue = (gchar*)attributeList->data;
+ attributeValue = attributeList->data;
#ifdef XMLWRITER_SUPPORTED
errorCode = xmlTextWriterWriteAttribute(writer,
@@ -580,7 +580,7 @@
return defaultValue;
}
else {
- return atoi(property);
+ return atoi((char*)property);
}
}
Index: src/consumers/test_group/client_group.c
===================================================================
RCS file: /sources/tsp/tsp/src/consumers/test_group/client_group.c,v
retrieving revision 1.7
diff -u -r1.7 client_group.c
--- src/consumers/test_group/client_group.c 24 Apr 2006 22:17:47 -0000 1.7
+++ src/consumers/test_group/client_group.c 6 Nov 2007 22:04:23 -0000
@@ -81,37 +81,37 @@
/* Calculated group numbers */
static group_test_t group_test[] = {
- { 10, -1, -1 , -1}, /*00*/
- /*01*/ { -1, -1, -1 , -1},
- /*02*/ { 10, 20, -1 , -1},
- /*03*/ { 30, -1, -1 , -1},
- /*04*/ { 10, -1, -1 , -1},
- /*05*/ { 20, -1, -1 , -1},
- /*06*/ { 10, -1, -1 , -1},
- /*07*/ { -1, -1, -1 , -1},
- /*08*/ { 10, 20, 30 , -1},
- /*09*/ { -1, -1, -1 , -1},
- /*10*/ { 10, -1, -1 , -1},
- /*11*/ { 20, -1, -1 , -1},
- /*12*/ { 10, -1, -1 , -1},
- /*13*/ { 30, -1, -1 , -1},
- /*14*/ { 10, 20, -1 , -1},
- /*15*/ { -1, -1, -1 , -1},
- /*16*/ { 10, -1, -1 , -1},
- /*17*/ { 20, -1, -1 , -1},
- /*18*/ { 10, 30, -1 , -1},
- /*19*/ { -1, -1, -1 , -1},
- /*20*/ { 10, 20, -1 , -1},
- /*21*/ { -1, -1, -1 , -1},
- /*22*/ { 10, -1, -1 , -1},
- /*23*/ { 20, 30, -1 , -1},
- /*24*/ { 10, -1, -1 , -1},
- /*25*/ { -1, -1, -1 , -1},
- /*26*/ { 10, 20, -1 , -1},
- /*27*/ { -1, -1, -1 , -1},
- /*28*/ { 10, 30, -1 , -1},
- /*29*/ { 20, -1, -1 , -1},
- /*30*/ { -2, -2, -2 , -2}
+ {{ 10, -1, -1 , -1}}, /*00*/
+ /*01*/ {{ -1, -1, -1 , -1}},
+ /*02*/ {{ 10, 20, -1 , -1}},
+ /*03*/ {{ 30, -1, -1 , -1}},
+ /*04*/ {{ 10, -1, -1 , -1}},
+ /*05*/ {{ 20, -1, -1 , -1}},
+ /*06*/ {{ 10, -1, -1 , -1}},
+ /*07*/ {{ -1, -1, -1 , -1}},
+ /*08*/ {{ 10, 20, 30 , -1}},
+ /*09*/ {{ -1, -1, -1 , -1}},
+ /*10*/ {{ 10, -1, -1 , -1}},
+ /*11*/ {{ 20, -1, -1 , -1}},
+ /*12*/ {{ 10, -1, -1 , -1}},
+ /*13*/ {{ 30, -1, -1 , -1}},
+ /*14*/ {{ 10, 20, -1 , -1}},
+ /*15*/ {{ -1, -1, -1 , -1}},
+ /*16*/ {{ 10, -1, -1 , -1}},
+ /*17*/ {{ 20, -1, -1 , -1}},
+ /*18*/ {{ 10, 30, -1 , -1}},
+ /*19*/ {{ -1, -1, -1 , -1}},
+ /*20*/ {{ 10, 20, -1 , -1}},
+ /*21*/ {{ -1, -1, -1 , -1}},
+ /*22*/ {{ 10, -1, -1 , -1}},
+ /*23*/ {{ 20, 30, -1 , -1}},
+ /*24*/ {{ 10, -1, -1 , -1}},
+ /*25*/ {{ -1, -1, -1 , -1}},
+ /*26*/ {{ 10, 20, -1 , -1}},
+ /*27*/ {{ -1, -1, -1 , -1}},
+ /*28*/ {{ 10, 30, -1 , -1}},
+ /*29*/ {{ 20, -1, -1 , -1}},
+ /*30*/ {{ -2, -2, -2 , -2}}
};
Index: src/core/ctrl/tsp_group_algo.c
===================================================================
RCS file: /sources/tsp/tsp/src/core/ctrl/tsp_group_algo.c,v
retrieving revision 1.23
diff -u -r1.23 tsp_group_algo.c
--- src/core/ctrl/tsp_group_algo.c 11 Feb 2007 21:45:56 -0000 1.23
+++ src/core/ctrl/tsp_group_algo.c 6 Nov 2007 22:04:23 -0000
@@ -369,7 +369,6 @@
TSP_group_algo_get_biggest_group_size(TSP_groups_t* groups) {
TSP_algo_table_t* group_table = (TSP_algo_table_t*)groups;
- int i;
assert(groups);
return group_table->group_max_byte_size;
Index: src/util/libpages/page_config.c
===================================================================
RCS file: /sources/tsp/tsp/src/util/libpages/page_config.c,v
retrieving revision 1.3
diff -u -r1.3 page_config.c
--- src/util/libpages/page_config.c 9 Oct 2005 23:01:26 -0000 1.3
+++ src/util/libpages/page_config.c 6 Nov 2007 22:04:23 -0000
@@ -9,29 +9,31 @@
/* Don't forget to update PGC_var_type_t AND var_type_str */
-static xmlChar* X_var_type_str[] = { "DOUBLE", "TITLE", "HEXA", "BIN", "STRING", NULL};
-static xmlChar* X_widget_type_str[] = { "view", "draw" ,NULL};
+static xmlChar* X_var_type_str[] = { BAD_CAST "DOUBLE", BAD_CAST "TITLE", BAD_CAST "HEXA", BAD_CAST "BIN", BAD_CAST "STRING", NULL};
+static xmlChar* X_widget_type_str[] = { BAD_CAST "view", BAD_CAST "draw" ,NULL};
-const xmlChar* PGC_LABEL_DOC="page_config";
-const xmlChar* PGC_LABEL_TRUE="true";
-const xmlChar* PGC_LABEL_FALSE="false";
-const xmlChar* PGC_LABEL_TITLE="title";
-const xmlChar* PGC_LABEL_X="x";
-const xmlChar* PGC_LABEL_Y="y";
-const xmlChar* PGC_LABEL_WIDTH="width";
-const xmlChar* PGC_LABEL_HEIGHT="height";
-const xmlChar* PGC_LABEL_VISIBLE="visible";
-const xmlChar* PGC_LABEL_NAME="name";
-const xmlChar* PGC_LABEL_TYPE="type";
-const xmlChar* PGC_LABEL_LEGEND="legend";
-const xmlChar* PGC_LABEL_PERIOD="period";
-const xmlChar* PGC_LABEL_DISPLAY_FREQUENCY="display_frequency";
-const xmlChar* PGC_LABEL_WIDGET="widget";
-const xmlChar* PGC_LABEL_ROWS="rows";
-const xmlChar* PGC_LABEL_NO_BORDER="no_border";
-const xmlChar* PGC_LABEL_DURATION="duration";
+const xmlChar* PGC_LABEL_DOC = BAD_CAST "page_config";
+const xmlChar* PGC_LABEL_TRUE = BAD_CAST "true";
+const xmlChar* PGC_LABEL_FALSE = BAD_CAST "false";
+const xmlChar* PGC_LABEL_TITLE = BAD_CAST "title";
+const xmlChar* PGC_LABEL_X = BAD_CAST "x";
+const xmlChar* PGC_LABEL_Y = BAD_CAST "y";
+const xmlChar* PGC_LABEL_WIDTH = BAD_CAST "width";
+const xmlChar* PGC_LABEL_HEIGHT = BAD_CAST "height";
+const xmlChar* PGC_LABEL_VISIBLE = BAD_CAST "visible";
+const xmlChar* PGC_LABEL_NAME = BAD_CAST "name";
+const xmlChar* PGC_LABEL_TYPE = BAD_CAST "type";
+const xmlChar* PGC_LABEL_LEGEND = BAD_CAST "legend";
+const xmlChar* PGC_LABEL_PERIOD = BAD_CAST "period";
+const xmlChar* PGC_LABEL_DISPLAY_FREQUENCY = BAD_CAST "display_frequency";
+const xmlChar* PGC_LABEL_WIDGET = BAD_CAST "widget";
+const xmlChar* PGC_LABEL_ROWS = BAD_CAST "rows";
+const xmlChar* PGC_LABEL_NO_BORDER = BAD_CAST "no_border";
+const xmlChar* PGC_LABEL_DURATION = BAD_CAST "duration";
+#define UTF_TO_CHAR (char*)
+
struct PGC_instance_t
{
xmlDocPtr doc;
@@ -61,7 +63,7 @@
xmlChar* buf = xmlGetProp(node, name); \
if(buf) \
{ \
- value = atoi(buf); \
+ value = atoi(UTF_TO_CHAR buf); \
xmlFree(buf); \
} \
else \
@@ -76,7 +78,7 @@
xmlChar* buf = xmlGetProp(node, name); \
if(buf) \
{ \
- value = atoi(buf); \
+ value = atoi(UTF_TO_CHAR buf); \
xmlFree(buf); \
} \
else \
@@ -92,7 +94,7 @@
xmlChar* buf = xmlGetProp(node, name); \
if(buf) \
{ \
- value = atof(buf); \
+ value = atof(UTF_TO_CHAR buf); \
xmlFree(buf); \
} \
else \
@@ -108,7 +110,7 @@
xmlChar* buf = xmlGetProp(node, name); \
if(buf) \
{ \
- value = atof(buf); \
+ value = atof(UTF_TO_CHAR buf); \
xmlFree(buf); \
} \
else \
@@ -122,7 +124,7 @@
xmlChar* buf = xmlGetProp(node, name); \
if(buf) \
{ \
- value = strdup(buf); \
+ value = strdup(UTF_TO_CHAR buf); \
xmlFree(buf); \
} \
else \
@@ -137,7 +139,7 @@
xmlChar* buf = xmlGetProp(node, name); \
if(buf) \
{ \
- value = strdup(buf); \
+ value = strdup(UTF_TO_CHAR buf); \
xmlFree(buf); \
} \
else \
_______________________________________________
Tsp-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/tsp-devel