openbsd-ports/x11/i3bar/patches/patch-src_workspaces_c
2011-05-05 12:19:36 +00:00

54 lines
2.1 KiB
Plaintext

$OpenBSD: patch-src_workspaces_c,v 1.1 2011/05/05 12:20:20 dcoppa Exp $
Make code compatible with libyajl-2.0 (API got changed)
--- src/workspaces.c.orig Mon May 2 11:43:04 2011
+++ src/workspaces.c Mon May 2 11:50:16 2011
@@ -57,7 +57,7 @@ static int workspaces_boolean_cb(void *params_, bool v
* Parse an integer (num or the rect)
*
*/
-static int workspaces_integer_cb(void *params_, long val) {
+static int workspaces_integer_cb(void *params_, long long val) {
struct workspaces_json_params *params = (struct workspaces_json_params*) params_;
if (!strcmp(params->cur_key, "num")) {
@@ -98,7 +98,7 @@ static int workspaces_integer_cb(void *params_, long v
* Parse a string (name, output)
*
*/
-static int workspaces_string_cb(void *params_, const unsigned char *val, unsigned int len) {
+static int workspaces_string_cb(void *params_, const unsigned char *val, size_t len) {
struct workspaces_json_params *params = (struct workspaces_json_params*) params_;
@@ -178,7 +178,7 @@ static int workspaces_start_map_cb(void *params_) {
* Essentially we just save it in the parsing-state
*
*/
-static int workspaces_map_key_cb(void *params_, const unsigned char *keyVal, unsigned int keyLen) {
+static int workspaces_map_key_cb(void *params_, const unsigned char *keyVal, size_t keyLen) {
struct workspaces_json_params *params = (struct workspaces_json_params*) params_;
FREE(params->cur_key);
@@ -224,10 +224,9 @@ void parse_workspaces_json(char *json) {
params.json = json;
yajl_handle handle;
- yajl_parser_config parse_conf = { 0, 0 };
yajl_status state;
- handle = yajl_alloc(&workspaces_callbacks, &parse_conf, NULL, (void*) &params);
+ handle = yajl_alloc(&workspaces_callbacks, NULL, (void*) &params);
state = yajl_parse(handle, (const unsigned char*) json, strlen(json));
@@ -236,7 +235,6 @@ void parse_workspaces_json(char *json) {
case yajl_status_ok:
break;
case yajl_status_client_canceled:
- case yajl_status_insufficient_data:
case yajl_status_error:
ELOG("Could not parse workspaces-reply!\n");
exit(EXIT_FAILURE);