From: paul k. <pau...@xs...> - 2005-06-06 07:23:45
|
Here is the cvs diff output to make the changes more clear: (Sorry I don't know how to create a diff file directly from cvs) Index: plugin_mysql.c =================================================================== RCS file: /cvsroot/lcd4linux/lcd4linux/plugin_mysql.c,v retrieving revision 1.6 diff -r1.6 plugin_mysql.c 192,193c192,193 < char *value = ""; < char *status; --- > const char *value = ""; > const char *status; 195c195 < if (configure_mysql > 0) { --- > if (configure_mysql() > 0) { paul kamphuis wrote: > Hi Michael, > > Here is the warning I get from the plugin_mysql.c file. > > gcc -DHAVE_CONFIG_H -I. -I. -I. -D_GNU_SOURCE -Wall -W -g -O2 -c > plugin_mysql.c > plugin_mysql.c: In function `my_MySQLstatus': > plugin_mysql.c:195: warning: ordered comparison of pointer with > integer zero > plugin_mysql.c:198: warning: assignment discards qualifiers from > pointer target type > > First one is a true bug. > This > if (configure_mysql > 0) { > should be > if (configure_mysql() > 0) { > > > For the second warning. > In my mysql/mysql.h is mysql_stat defined as > const char * STDCALL mysql_stat(MYSQL *mysql); > So need to use some const qualifiers: > > Here is the modified function. I can't commit the changes because of > some "sticky flag" :-( > > static void my_MySQLstatus(RESULT * result) > { > *const *char *value = ""; > *const *char *status; > > if (*configure_mysql() *> 0) { > > mysql_ping(&conex); > status = mysql_stat(&conex); > if (!status) { > error("[MySQL] status error: %s", mysql_error(&conex)); > value = "error"; > } else { > value = status; > } > } > > SetResult(&result, R_STRING, value); > } > > Cheers, > > Paul > > > ------------------------------------------------------- > This SF.Net email is sponsored by: NEC IT Guy Games. How far can you > shotput > a projector? How fast can you ride your desk chair down the office > luge track? > If you want to score the big prize, get to know the little guy. Play > to win an NEC 61" plasma display: http://www.necitguy.com/?r=20 > _______________________________________________ > Lcd4linux-devel mailing list > Lcd...@li... > https://lists.sourceforge.net/lists/listinfo/lcd4linux-devel > > |