diff options
author | Tony Crisci <tony@dubstepdish.com> | 2014-05-03 21:02:54 -0400 |
---|---|---|
committer | Michael Stapelberg <michael@stapelberg.de> | 2014-05-04 22:52:37 +0200 |
commit | 13db56255134a71acd2fd5a7e254adfbd0c2983b (patch) | |
tree | 9d17acac151ec00ec480939245f4c39c1212cd0d /i3-msg | |
parent | 22b4215d9238d2b9ac64eb9a65afb5faa4ce33cc (diff) | |
download | i3-13db56255134a71acd2fd5a7e254adfbd0c2983b.tar.gz i3-13db56255134a71acd2fd5a7e254adfbd0c2983b.zip |
Remove yajl major version conditionals
Yajl version ≥ 2 is required.
fixes #1156
Diffstat (limited to 'i3-msg')
-rw-r--r-- | i3-msg/main.c | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/i3-msg/main.c b/i3-msg/main.c index 513f2892..15a03aed 100644 --- a/i3-msg/main.c +++ b/i3-msg/main.c @@ -76,11 +76,7 @@ static int reply_boolean_cb(void *params, int val) { return 1; } -#if YAJL_MAJOR >= 2 static int reply_string_cb(void *params, const unsigned char *val, size_t len) { -#else -static int reply_string_cb(void *params, const unsigned char *val, unsigned int len) { -#endif char *str = scalloc(len + 1); strncpy(str, (const char*)val, len); if (strcmp(last_key, "error") == 0) @@ -107,11 +103,7 @@ static int reply_end_map_cb(void *params) { } -#if YAJL_MAJOR >= 2 static int reply_map_key_cb(void *params, const unsigned char *keyVal, size_t keyLen) { -#else -static int reply_map_key_cb(void *params, const unsigned char *keyVal, unsigned keyLen) { -#endif free(last_key); last_key = scalloc(keyLen + 1); strncpy(last_key, (const char*)keyVal, keyLen); @@ -239,21 +231,12 @@ int main(int argc, char *argv[]) { * If not, nicely format the error message. */ if (reply_type == I3_IPC_MESSAGE_TYPE_COMMAND) { yajl_handle handle; -#if YAJL_MAJOR < 2 - yajl_parser_config parse_conf = { 0, 0 }; - - handle = yajl_alloc(&reply_callbacks, &parse_conf, NULL, NULL); -#else handle = yajl_alloc(&reply_callbacks, NULL, NULL); -#endif yajl_status state = yajl_parse(handle, (const unsigned char*)reply, reply_length); switch (state) { case yajl_status_ok: break; case yajl_status_client_canceled: -#if YAJL_MAJOR < 2 - case yajl_status_insufficient_data: -#endif case yajl_status_error: errx(EXIT_FAILURE, "IPC: Could not parse JSON reply."); } |