fix some compiler warnings

next
Michael Stapelberg 2011-02-01 15:43:59 +01:00
parent 8f4b9ddaa4
commit 0238ce3c73
3 changed files with 7 additions and 7 deletions

View File

@ -35,7 +35,7 @@ struct context {
char *line_copy; char *line_copy;
const char *filename; const char *filename;
const char *compact_error; char *compact_error;
/* These are the same as in YYLTYPE */ /* These are the same as in YYLTYPE */
int first_column; int first_column;

View File

@ -262,8 +262,8 @@ criteria:
{ {
printf("criteria: id = %s\n", $<string>3); printf("criteria: id = %s\n", $<string>3);
/* TODO: correctly parse number */ /* TODO: correctly parse number */
current_match.con_id = atoi($<string>3); current_match.con_id = (Con*)atoi($<string>3);
printf("id as int = %d\n", current_match.con_id); printf("id as int = %p\n", current_match.con_id);
} }
| TOK_ID '=' STR | TOK_ID '=' STR
{ {
@ -360,8 +360,8 @@ focus:
printf("should focus\n"); printf("should focus\n");
if (match_is_empty(&current_match)) { if (match_is_empty(&current_match)) {
/* TODO: better error message */ /* TODO: better error message */
LOG("Error: The foucs command requires you to use some criteria.\n"); LOG("Error: The focus command requires you to use some criteria.\n");
return; break;
} }
/* TODO: warning if the match contains more than one entry. does not /* TODO: warning if the match contains more than one entry. does not
@ -406,7 +406,7 @@ open:
{ {
printf("opening new container\n"); printf("opening new container\n");
Con *con = tree_open_con(NULL); Con *con = tree_open_con(NULL);
asprintf(&json_output, "{\"success\":true, \"id\":%d}", (long int)con); asprintf(&json_output, "{\"success\":true, \"id\":%ld}", (long int)con);
} }
; ;

View File

@ -197,7 +197,7 @@ void tree_append_json(const char *filename) {
stat != yajl_status_insufficient_data) stat != yajl_status_insufficient_data)
{ {
unsigned char * str = yajl_get_error(hand, 1, (const unsigned char*)buf, n); unsigned char * str = yajl_get_error(hand, 1, (const unsigned char*)buf, n);
fprintf(stderr, (const char *) str); fprintf(stderr, "%s\n", (const char *) str);
yajl_free_error(hand, str); yajl_free_error(hand, str);
} }