r5261 jmb - in /trunk/libcss/test: lex-auto.c lex.c parse.c

netsurf at semichrome.net netsurf at semichrome.net
Fri Sep 5 16:20:32 BST 2008


Author: jmb
Date: Fri Sep  5 10:20:32 2008
New Revision: 5261

URL: http://source.netsurf-browser.org?rev=5261&view=rev
Log:
Fix compilation of test drivers on 64bit platforms.

Modified:
    trunk/libcss/test/lex-auto.c
    trunk/libcss/test/lex.c
    trunk/libcss/test/parse.c

Modified: trunk/libcss/test/lex-auto.c
URL: http://source.netsurf-browser.org/trunk/libcss/test/lex-auto.c?rev=5261&r1=5260&r2=5261&view=diff
==============================================================================
--- trunk/libcss/test/lex-auto.c (original)
+++ trunk/libcss/test/lex-auto.c Fri Sep  5 10:20:32 2008
@@ -298,7 +298,7 @@
 
 		if (exp[e].textLen > 0) {
 			if (tok->data.len != exp[e].textLen) {
-				printf("%d: Got length %d, Expected %d\n",
+				printf("%d: Got length %zd, Expected %zd\n",
 					testnum, tok->data.len, exp[e].textLen);
 				assert(0 && "Text lengths differ");
 			}
@@ -306,8 +306,9 @@
 			if (strncmp((char *) tok->data.ptr, exp[e].text, 
 					tok->data.len) != 0) {
 				printf("%d: Got data '%.*s', Expected '%.*s'\n",
-					testnum, tok->data.len, tok->data.ptr,
-					exp[e].textLen, exp[e].text);
+					testnum, 
+					(int) tok->data.len, tok->data.ptr,
+					(int) exp[e].textLen, exp[e].text);
 				assert(0 && "Text differs");
 			}
 		}

Modified: trunk/libcss/test/lex.c
URL: http://source.netsurf-browser.org/trunk/libcss/test/lex.c?rev=5261&r1=5260&r2=5261&view=diff
==============================================================================
--- trunk/libcss/test/lex.c (original)
+++ trunk/libcss/test/lex.c Fri Sep  5 10:20:32 2008
@@ -29,34 +29,43 @@
 
 	switch (token->type) {
 	case CSS_TOKEN_IDENT:
-		printf("IDENT(%.*s)", token->data.len, token->data.ptr);
+		printf("IDENT(%.*s)", 
+				(int) token->data.len, token->data.ptr);
 		break;
 	case CSS_TOKEN_ATKEYWORD:
-		printf("ATKEYWORD(%.*s)", token->data.len, token->data.ptr);
+		printf("ATKEYWORD(%.*s)", 
+				(int) token->data.len, token->data.ptr);
 		break;
 	case CSS_TOKEN_STRING:
-		printf("STRING(%.*s)", token->data.len, token->data.ptr);
+		printf("STRING(%.*s)", 
+				(int) token->data.len, token->data.ptr);
 		break;
 	case CSS_TOKEN_INVALID_STRING:
-		printf("INVALID(%.*s)", token->data.len, token->data.ptr);
+		printf("INVALID(%.*s)", 
+				(int) token->data.len, token->data.ptr);
 		break;
 	case CSS_TOKEN_HASH:
-		printf("HASH(%.*s)", token->data.len, token->data.ptr);
+		printf("HASH(%.*s)", 
+				(int) token->data.len, token->data.ptr);
 		break;
 	case CSS_TOKEN_NUMBER:
-		printf("NUMBER(%.*s)", token->data.len, token->data.ptr);
+		printf("NUMBER(%.*s)", 
+				(int) token->data.len, token->data.ptr);
 		break;
 	case CSS_TOKEN_PERCENTAGE:
-		printf("PERCENTAGE(%.*s)", token->data.len, token->data.ptr);
+		printf("PERCENTAGE(%.*s)", 
+				(int) token->data.len, token->data.ptr);
 		break;
 	case CSS_TOKEN_DIMENSION:
-		printf("DIMENSION(%.*s)", token->data.len, token->data.ptr);
+		printf("DIMENSION(%.*s)", 
+				(int) token->data.len, token->data.ptr);
 		break;
 	case CSS_TOKEN_URI:
-		printf("URI(%.*s)", token->data.len, token->data.ptr);
+		printf("URI(%.*s)", (int) token->data.len, token->data.ptr);
 		break;
 	case CSS_TOKEN_UNICODE_RANGE:
-		printf("UNICODE-RANGE(%.*s)", token->data.len, token->data.ptr);
+		printf("UNICODE-RANGE(%.*s)", 
+				(int) token->data.len, token->data.ptr);
 		break;
 	case CSS_TOKEN_CDO:
 		printf("CDO");
@@ -68,10 +77,11 @@
 		printf("S");
 		break;
 	case CSS_TOKEN_COMMENT:
-		printf("COMMENT(%.*s)", token->data.len, token->data.ptr);
+		printf("COMMENT(%.*s)", (int) token->data.len, token->data.ptr);
 		break;
 	case CSS_TOKEN_FUNCTION:
-		printf("FUNCTION(%.*s)", token->data.len, token->data.ptr);
+		printf("FUNCTION(%.*s)", 
+				(int) token->data.len, token->data.ptr);
 		break;
 	case CSS_TOKEN_INCLUDES:
 		printf("INCLUDES");
@@ -89,7 +99,7 @@
 		printf("SUBSTRINGMATCH");
 		break;
 	case CSS_TOKEN_CHAR:
-		printf("CHAR(%.*s)", token->data.len, token->data.ptr);
+		printf("CHAR(%.*s)", (int) token->data.len, token->data.ptr);
 		break;
 	case CSS_TOKEN_EOF:
 		printf("EOF");

Modified: trunk/libcss/test/parse.c
URL: http://source.netsurf-browser.org/trunk/libcss/test/parse.c?rev=5261&r1=5260&r2=5261&view=diff
==============================================================================
--- trunk/libcss/test/parse.c (original)
+++ trunk/libcss/test/parse.c Fri Sep  5 10:20:32 2008
@@ -59,7 +59,7 @@
 		printf("\n    %d", token->type);
 
 		if (token->data.ptr != NULL)
-			printf(" %.*s", token->data.len, token->data.ptr);
+			printf(" %.*s", (int) token->data.len, token->data.ptr);
 	} while (token != NULL);
 
 	printf("\n");




More information about the netsurf-commits mailing list