[mw-devel] MARVIN r96 - branches/smonkey

welshbyte at sucs.org welshbyte at sucs.org
Thu Mar 8 00:54:10 GMT 2007


Author: welshbyte
Date: 2007-03-08 00:54:09 +0000 (Thu, 08 Mar 2007)
New Revision: 96

Modified:
   branches/smonkey/js.c
   branches/smonkey/sqlite.c
Log:
A bit of housekeeping to shut the compiler warnings up


Modified: branches/smonkey/js.c
===================================================================
--- branches/smonkey/js.c	2007-03-07 20:14:16 UTC (rev 95)
+++ branches/smonkey/js.c	2007-03-08 00:54:09 UTC (rev 96)
@@ -33,7 +33,7 @@
 	char * utf16cpy;
 	char * charset;
 	iconv_t conv;
-	int nconv;
+	size_t nconv;
 	size_t localbytesleft;
 	size_t utf16bytesleft;
 	char * localcpy;
@@ -93,10 +93,10 @@
  * debugging and demonstrates how to call C from js)
  */
 static JSBool
-js_print(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) {
+js_print(JSContext *cx, JSObject __attribute__((unused)) *obj, uintN argc, jsval *argv, jsval __attribute__((unused)) *rval) {
 	JSString *jsmsg;
 	size_t len;
-	int i;
+	uintN i;
 	
 	jschar * ucmsg;
 	char * msg;
@@ -190,14 +190,12 @@
 
 // Provides a javascript function to query an sqlite3 database
 static JSBool
-js_doquery(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) {
+js_doquery(JSContext *cx, JSObject __attribute__((unused)) *obj, uintN argc, jsval *argv, jsval *rval) {
 	struct db_result *dbres;
 	char *dbname;
 	char *query;
-	struct JSPropertySpec myspec[3];
 	JSObject *result; // result object were creating
 	JSObject *resarray;
-	JSBool ok;
 
 	if (argc != 2) {
 		return JS_FALSE;
@@ -246,7 +244,7 @@
 	char * utf16cpy;
 	char * charset;
 	iconv_t conv;
-	int nconv;
+	size_t nconv;
 	size_t localbytesleft;
 	size_t utf16bytesleft;
 	char * localcpy;
@@ -384,7 +382,7 @@
 /* Prints error reports to stdout when a javascript error occurs */
 /* Taken from the spidermonkey tutorial at Kicken's World */
 static void 
-js_error_handler(JSContext *cx, const char *msg, JSErrorReport *er)
+js_error_handler(JSContext __attribute__((unused)) *cx, const char *msg, JSErrorReport *er)
 {
 	char *pointer=NULL;
 	char *line=NULL;

Modified: branches/smonkey/sqlite.c
===================================================================
--- branches/smonkey/sqlite.c	2007-03-07 20:14:16 UTC (rev 95)
+++ branches/smonkey/sqlite.c	2007-03-08 00:54:09 UTC (rev 96)
@@ -15,6 +15,13 @@
 	return db;
 }
 
+void
+db_close(sqlite3 *db)
+{
+	printf("Closing database %p\n", (void *)db);
+	sqlite3_close(db);
+}
+
 int
 db_callback(void *ptr, int ncols, char **row, char **cols)
 {
@@ -160,9 +167,3 @@
 	free(result);
 }
 
-void db_close(sqlite3 *db)
-{
-	printf("Closing database %p\n", (void *)db);
-	sqlite3_close(db);
-}
-





More information about the mw-devel mailing list