Remove yajl major version conditionals

Yajl version ≥ 2 is required.

fixes #1156
This commit is contained in:
Tony Crisci
2014-05-03 21:02:54 -04:00
committed by Michael Stapelberg
parent 22b4215d92
commit 13db562551
17 changed files with 4 additions and 221 deletions

View File

@ -58,11 +58,7 @@ static int workspaces_boolean_cb(void *params_, int val) {
* Parse an integer (num or the rect)
*
*/
#if YAJL_MAJOR >= 2
static int workspaces_integer_cb(void *params_, long long val) {
#else
static int workspaces_integer_cb(void *params_, long val) {
#endif
struct workspaces_json_params *params = (struct workspaces_json_params*) params_;
if (!strcmp(params->cur_key, "num")) {
@ -103,11 +99,7 @@ static int workspaces_integer_cb(void *params_, long val) {
* Parse a string (name, output)
*
*/
#if YAJL_MAJOR >= 2
static int workspaces_string_cb(void *params_, const unsigned char *val, size_t len) {
#else
static int workspaces_string_cb(void *params_, const unsigned char *val, unsigned int len) {
#endif
struct workspaces_json_params *params = (struct workspaces_json_params*) params_;
char *output_name;
@ -182,11 +174,7 @@ static int workspaces_start_map_cb(void *params_) {
* Essentially we just save it in the parsing-state
*
*/
#if YAJL_MAJOR >= 2
static int workspaces_map_key_cb(void *params_, const unsigned char *keyVal, size_t keyLen) {
#else
static int workspaces_map_key_cb(void *params_, const unsigned char *keyVal, unsigned int keyLen) {
#endif
struct workspaces_json_params *params = (struct workspaces_json_params*) params_;
FREE(params->cur_key);
@ -223,13 +211,7 @@ void parse_workspaces_json(char *json) {
yajl_handle handle;
yajl_status state;
#if YAJL_MAJOR < 2
yajl_parser_config parse_conf = { 0, 0 };
handle = yajl_alloc(&workspaces_callbacks, &parse_conf, NULL, (void*) &params);
#else
handle = yajl_alloc(&workspaces_callbacks, NULL, (void*) &params);
#endif
state = yajl_parse(handle, (const unsigned char*) json, strlen(json));
@ -238,9 +220,6 @@ void parse_workspaces_json(char *json) {
case yajl_status_ok:
break;
case yajl_status_client_canceled:
#if YAJL_MAJOR < 2
case yajl_status_insufficient_data:
#endif
case yajl_status_error:
ELOG("Could not parse workspaces-reply!\n");
exit(EXIT_FAILURE);