summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/lex-auto.c7
-rw-r--r--test/lex.c36
-rw-r--r--test/parse.c2
3 files changed, 28 insertions, 17 deletions
diff --git a/test/lex-auto.c b/test/lex-auto.c
index e148649..98d0871 100644
--- a/test/lex-auto.c
+++ b/test/lex-auto.c
@@ -298,7 +298,7 @@ void run_test(const uint8_t *data, size_t len, exp_entry *exp, size_t explen)
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 @@ void run_test(const uint8_t *data, size_t len, exp_entry *exp, size_t explen)
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");
}
}
diff --git a/test/lex.c b/test/lex.c
index 22da973..cba2d8f 100644
--- a/test/lex.c
+++ b/test/lex.c
@@ -29,34 +29,43 @@ static void printToken(const css_token *token)
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 @@ static void printToken(const css_token *token)
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 @@ static void printToken(const css_token *token)
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");
diff --git a/test/parse.c b/test/parse.c
index 25d1759..1752dc2 100644
--- a/test/parse.c
+++ b/test/parse.c
@@ -59,7 +59,7 @@ static css_error event_handler(css_parser_event type,
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");