Browse Source

Various warnings fixed (mostly appearing with 64b compiles).

Closes issue SER-343.
Bogdan Pintea 17 years ago
parent
commit
03d7d3b902
2 changed files with 4 additions and 3 deletions
  1. 2 2
      select.c
  2. 2 1
      str.h

+ 2 - 2
select.c

@@ -134,12 +134,12 @@ int w_parse_select(char**p, select_t* sel)
 		(*p)++;
 		(*p)++;
 	};
 	};
 	if (sel->n==0) {
 	if (sel->n==0) {
-		ERR("parse_select: invalid select '%.*s'\n", *p - select_name, select_name);
+		ERR("parse_select: invalid select '%.*s'\n", (int)(*p - select_name), select_name);
 		goto error;
 		goto error;
 	};
 	};
 	DBG("parse_select: end, total elements: %d, calling resolve_select\n", sel->n);
 	DBG("parse_select: end, total elements: %d, calling resolve_select\n", sel->n);
 	if (resolve_select(sel)<0) {
 	if (resolve_select(sel)<0) {
-		ERR("parse_select: error while resolve_select '%.*s'\n", *p - select_name, select_name);
+		ERR("parse_select: error while resolve_select '%.*s'\n", (int)(*p - select_name), select_name);
 		goto error;
 		goto error;
 	}
 	}
 	return 0;
 	return 0;

+ 2 - 1
str.h

@@ -103,7 +103,8 @@ typedef struct _str str;
  * more details.
  * more details.
  */
  */
 #define STR_FMT(_pstr_)	\
 #define STR_FMT(_pstr_)	\
-  ((_pstr_) ? (_pstr_)->len : 0), ((_pstr_) ? (_pstr_)->s : "")
+  ((_pstr_ != (str *)0) ? (_pstr_)->len : 0), \
+  ((_pstr_ != (str *)0) ? (_pstr_)->s : "")
 
 
 
 
 /** Compares two ::str strings.
 /** Compares two ::str strings.