diff --git a/compat/jansson-2.5/src/dump.c b/compat/jansson-2.5/src/dump.c index 3b19c73b..dae12bee 100644 --- a/compat/jansson-2.5/src/dump.c +++ b/compat/jansson-2.5/src/dump.c @@ -306,7 +306,7 @@ static int do_dump(const json_t *json, size_t flags, int depth, int (*cmp_func)(const void *, const void *); size = json_object_size(json); - keys = jsonp_malloc(size * sizeof(struct object_key)); + keys = (object_key *)jsonp_malloc(size * sizeof(struct object_key)); if(!keys) goto object_error; diff --git a/compat/jansson-2.5/src/hashtable.c b/compat/jansson-2.5/src/hashtable.c index 5fb04679..34b819c1 100644 --- a/compat/jansson-2.5/src/hashtable.c +++ b/compat/jansson-2.5/src/hashtable.c @@ -170,7 +170,7 @@ static int hashtable_do_rehash(hashtable_t *hashtable) hashtable->num_buckets++; new_size = num_buckets(hashtable); - hashtable->buckets = jsonp_malloc(new_size * sizeof(bucket_t)); + hashtable->buckets = (struct hashtable_bucket *)jsonp_malloc(new_size * sizeof(bucket_t)); if(!hashtable->buckets) return -1; @@ -200,7 +200,7 @@ int hashtable_init(hashtable_t *hashtable) hashtable->size = 0; hashtable->num_buckets = 0; /* index to primes[] */ - hashtable->buckets = jsonp_malloc(num_buckets(hashtable) * sizeof(bucket_t)); + hashtable->buckets = (struct hashtable_bucket *)jsonp_malloc(num_buckets(hashtable) * sizeof(bucket_t)); if(!hashtable->buckets) return -1; @@ -249,7 +249,7 @@ int hashtable_set(hashtable_t *hashtable, /* offsetof(...) returns the size of pair_t without the last, flexible member. This way, the correct amount is allocated. */ - pair = jsonp_malloc(offsetof(pair_t, key) + strlen(key) + 1); + pair = (pair_t *)jsonp_malloc(offsetof(pair_t, key) + strlen(key) + 1); if(!pair) return -1; diff --git a/compat/jansson-2.5/src/load.c b/compat/jansson-2.5/src/load.c index 41c766c2..0cfa082a 100644 --- a/compat/jansson-2.5/src/load.c +++ b/compat/jansson-2.5/src/load.c @@ -933,7 +933,7 @@ typedef struct static int buffer_get(void *data) { char c; - buffer_data_t *stream = data; + buffer_data_t *stream = (buffer_data_t *)data; if(stream->pos >= stream->len) return EOF; @@ -1035,7 +1035,7 @@ typedef struct static int callback_get(void *data) { char c; - callback_data_t *stream = data; + callback_data_t *stream = (callback_data_t *)data; if(stream->pos >= stream->len) { stream->pos = 0; diff --git a/compat/jansson-2.5/src/value.c b/compat/jansson-2.5/src/value.c index cc2e3f9d..d47ff5d5 100644 --- a/compat/jansson-2.5/src/value.c +++ b/compat/jansson-2.5/src/value.c @@ -38,7 +38,7 @@ static JSON_INLINE void json_init(json_t *json, json_type type) json_t *json_object(void) { - json_object_t *object = jsonp_malloc(sizeof(json_object_t)); + json_object_t *object = (json_object_t *)jsonp_malloc(sizeof(json_object_t)); if(!object) return NULL; json_init(&object->json, JSON_OBJECT); @@ -80,7 +80,7 @@ json_t *json_object_get(const json_t *json, const char *key) return NULL; object = json_to_object(json); - return hashtable_get(&object->hashtable, key); + return (json_t *)hashtable_get(&object->hashtable, key); } int json_object_set_new_nocheck(json_t *json, const char *key, json_t *value) @@ -322,7 +322,7 @@ static json_t *json_object_deep_copy(const json_t *object) json_t *json_array(void) { - json_array_t *array = jsonp_malloc(sizeof(json_array_t)); + json_array_t *array = (json_array_t *)jsonp_malloc(sizeof(json_array_t)); if(!array) return NULL; json_init(&array->json, JSON_ARRAY); @@ -330,7 +330,7 @@ json_t *json_array(void) array->entries = 0; array->size = 8; - array->table = jsonp_malloc(array->size * sizeof(json_t *)); + array->table = (json_t **)jsonp_malloc(array->size * sizeof(json_t *)); if(!array->table) { jsonp_free(array); return NULL; @@ -425,7 +425,7 @@ static json_t **json_array_grow(json_array_t *array, old_table = array->table; new_size = max(array->size + amount, array->size * 2); - new_table = jsonp_malloc(new_size * sizeof(json_t *)); + new_table = (json_t **)jsonp_malloc(new_size * sizeof(json_t *)); if(!new_table) return NULL; @@ -627,7 +627,7 @@ json_t *json_string_nocheck(const char *value) if(!value) return NULL; - string = jsonp_malloc(sizeof(json_string_t)); + string = (json_string_t *)jsonp_malloc(sizeof(json_string_t)); if(!string) return NULL; json_init(&string->json, JSON_STRING); @@ -705,7 +705,7 @@ static json_t *json_string_copy(const json_t *string) json_t *json_integer(json_int_t value) { - json_integer_t *integer = jsonp_malloc(sizeof(json_integer_t)); + json_integer_t *integer = (json_integer_t *)jsonp_malloc(sizeof(json_integer_t)); if(!integer) return NULL; json_init(&integer->json, JSON_INTEGER); @@ -757,7 +757,7 @@ json_t *json_real(double value) if(isnan(value) || isinf(value)) return NULL; - real = jsonp_malloc(sizeof(json_real_t)); + real = (json_real_t *)jsonp_malloc(sizeof(json_real_t)); if(!real) return NULL; json_init(&real->json, JSON_REAL); diff --git a/winbuild/dist/include/jansson.h b/winbuild/dist/include/jansson.h deleted file mode 100644 index c4975985..00000000 --- a/winbuild/dist/include/jansson.h +++ /dev/null @@ -1,287 +0,0 @@ -/* - * Copyright (c) 2009-2013 Petri Lehtinen - * - * Jansson is free software; you can redistribute it and/or modify - * it under the terms of the MIT license. See LICENSE for details. - */ - -#ifndef JANSSON_H -#define JANSSON_H - -#include -#include /* for size_t */ -#include - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* version */ - -#define JANSSON_MAJOR_VERSION 2 -#define JANSSON_MINOR_VERSION 5 -#define JANSSON_MICRO_VERSION 0 - -/* Micro version is omitted if it's 0 */ -#define JANSSON_VERSION "2.5" - -/* Version as a 3-byte hex number, e.g. 0x010201 == 1.2.1. Use this - for numeric comparisons, e.g. #if JANSSON_VERSION_HEX >= ... */ -#define JANSSON_VERSION_HEX ((JANSSON_MAJOR_VERSION << 16) | \ - (JANSSON_MINOR_VERSION << 8) | \ - (JANSSON_MICRO_VERSION << 0)) - - -/* types */ - -typedef enum { - JSON_OBJECT, - JSON_ARRAY, - JSON_STRING, - JSON_INTEGER, - JSON_REAL, - JSON_TRUE, - JSON_FALSE, - JSON_NULL -} json_type; - -typedef struct json_t { - json_type type; - size_t refcount; -} json_t; - -#ifndef JANSSON_USING_CMAKE /* disabled if using cmake */ -#if JSON_INTEGER_IS_LONG_LONG -#ifdef _WIN32 -#define JSON_INTEGER_FORMAT "I64d" -#else -#define JSON_INTEGER_FORMAT "lld" -#endif -typedef long long json_int_t; -#else -#define JSON_INTEGER_FORMAT "ld" -typedef long json_int_t; -#endif /* JSON_INTEGER_IS_LONG_LONG */ -#endif - -#define json_typeof(json) ((json)->type) -#define json_is_object(json) ((json) && json_typeof(json) == JSON_OBJECT) -#define json_is_array(json) ((json) && json_typeof(json) == JSON_ARRAY) -#define json_is_string(json) ((json) && json_typeof(json) == JSON_STRING) -#define json_is_integer(json) ((json) && json_typeof(json) == JSON_INTEGER) -#define json_is_real(json) ((json) && json_typeof(json) == JSON_REAL) -#define json_is_number(json) (json_is_integer(json) || json_is_real(json)) -#define json_is_true(json) ((json) && json_typeof(json) == JSON_TRUE) -#define json_is_false(json) ((json) && json_typeof(json) == JSON_FALSE) -#define json_boolean_value json_is_true -#define json_is_boolean(json) (json_is_true(json) || json_is_false(json)) -#define json_is_null(json) ((json) && json_typeof(json) == JSON_NULL) - -/* construction, destruction, reference counting */ - -json_t *json_object(void); -json_t *json_array(void); -json_t *json_string(const char *value); -json_t *json_stringn(const char *value, size_t len); -json_t *json_string_nocheck(const char *value); -json_t *json_stringn_nocheck(const char *value, size_t len); -json_t *json_integer(json_int_t value); -json_t *json_real(double value); -json_t *json_true(void); -json_t *json_false(void); -#define json_boolean(val) ((val) ? json_true() : json_false()) -json_t *json_null(void); - -static JSON_INLINE -json_t *json_incref(json_t *json) -{ - if(json && json->refcount != (size_t)-1) - ++json->refcount; - return json; -} - -/* do not call json_delete directly */ -void json_delete(json_t *json); - -static JSON_INLINE -void json_decref(json_t *json) -{ - if(json && json->refcount != (size_t)-1 && --json->refcount == 0) - json_delete(json); -} - - -/* error reporting */ - -#define JSON_ERROR_TEXT_LENGTH 160 -#define JSON_ERROR_SOURCE_LENGTH 80 - -typedef struct { - int line; - int column; - int position; - char source[JSON_ERROR_SOURCE_LENGTH]; - char text[JSON_ERROR_TEXT_LENGTH]; -} json_error_t; - - -/* getters, setters, manipulation */ - -size_t json_object_size(const json_t *object); -json_t *json_object_get(const json_t *object, const char *key); -int json_object_set_new(json_t *object, const char *key, json_t *value); -int json_object_set_new_nocheck(json_t *object, const char *key, json_t *value); -int json_object_del(json_t *object, const char *key); -int json_object_clear(json_t *object); -int json_object_update(json_t *object, json_t *other); -int json_object_update_existing(json_t *object, json_t *other); -int json_object_update_missing(json_t *object, json_t *other); -void *json_object_iter(json_t *object); -void *json_object_iter_at(json_t *object, const char *key); -void *json_object_key_to_iter(const char *key); -void *json_object_iter_next(json_t *object, void *iter); -const char *json_object_iter_key(void *iter); -json_t *json_object_iter_value(void *iter); -int json_object_iter_set_new(json_t *object, void *iter, json_t *value); - -#define json_object_foreach(object, key, value) \ - for(key = json_object_iter_key(json_object_iter(object)); \ - key && (value = json_object_iter_value(json_object_key_to_iter(key))); \ - key = json_object_iter_key(json_object_iter_next(object, json_object_key_to_iter(key)))) - -#define json_array_foreach(array, index, value) \ - for(index = 0; \ - index < json_array_size(array) && (value = json_array_get(array, index)); \ - index++) - -static JSON_INLINE -int json_object_set(json_t *object, const char *key, json_t *value) -{ - return json_object_set_new(object, key, json_incref(value)); -} - -static JSON_INLINE -int json_object_set_nocheck(json_t *object, const char *key, json_t *value) -{ - return json_object_set_new_nocheck(object, key, json_incref(value)); -} - -static JSON_INLINE -int json_object_iter_set(json_t *object, void *iter, json_t *value) -{ - return json_object_iter_set_new(object, iter, json_incref(value)); -} - -size_t json_array_size(const json_t *array); -json_t *json_array_get(const json_t *array, size_t index); -int json_array_set_new(json_t *array, size_t index, json_t *value); -int json_array_append_new(json_t *array, json_t *value); -int json_array_insert_new(json_t *array, size_t index, json_t *value); -int json_array_remove(json_t *array, size_t index); -int json_array_clear(json_t *array); -int json_array_extend(json_t *array, json_t *other); - -static JSON_INLINE -int json_array_set(json_t *array, size_t ind, json_t *value) -{ - return json_array_set_new(array, ind, json_incref(value)); -} - -static JSON_INLINE -int json_array_append(json_t *array, json_t *value) -{ - return json_array_append_new(array, json_incref(value)); -} - -static JSON_INLINE -int json_array_insert(json_t *array, size_t ind, json_t *value) -{ - return json_array_insert_new(array, ind, json_incref(value)); -} - -const char *json_string_value(const json_t *string); -size_t json_string_length(const json_t *string); -json_int_t json_integer_value(const json_t *integer); -double json_real_value(const json_t *real); -double json_number_value(const json_t *json); - -int json_string_set(json_t *string, const char *value); -int json_string_setn(json_t *string, const char *value, size_t len); -int json_string_set_nocheck(json_t *string, const char *value); -int json_string_setn_nocheck(json_t *string, const char *value, size_t len); -int json_integer_set(json_t *integer, json_int_t value); -int json_real_set(json_t *real, double value); - -/* pack, unpack */ - -json_t *json_pack(const char *fmt, ...); -json_t *json_pack_ex(json_error_t *error, size_t flags, const char *fmt, ...); -json_t *json_vpack_ex(json_error_t *error, size_t flags, const char *fmt, va_list ap); - -#define JSON_VALIDATE_ONLY 0x1 -#define JSON_STRICT 0x2 - -int json_unpack(json_t *root, const char *fmt, ...); -int json_unpack_ex(json_t *root, json_error_t *error, size_t flags, const char *fmt, ...); -int json_vunpack_ex(json_t *root, json_error_t *error, size_t flags, const char *fmt, va_list ap); - - -/* equality */ - -int json_equal(json_t *value1, json_t *value2); - - -/* copying */ - -json_t *json_copy(json_t *value); -json_t *json_deep_copy(const json_t *value); - - -/* decoding */ - -#define JSON_REJECT_DUPLICATES 0x1 -#define JSON_DISABLE_EOF_CHECK 0x2 -#define JSON_DECODE_ANY 0x4 -#define JSON_DECODE_INT_AS_REAL 0x8 -#define JSON_ALLOW_NUL 0x10 - -typedef size_t (*json_load_callback_t)(void *buffer, size_t buflen, void *data); - -json_t *json_loads(const char *input, size_t flags, json_error_t *error); -json_t *json_loadb(const char *buffer, size_t buflen, size_t flags, json_error_t *error); -json_t *json_loadf(FILE *input, size_t flags, json_error_t *error); -json_t *json_load_file(const char *path, size_t flags, json_error_t *error); -json_t *json_load_callback(json_load_callback_t callback, void *data, size_t flags, json_error_t *error); - - -/* encoding */ - -#define JSON_INDENT(n) (n & 0x1F) -#define JSON_COMPACT 0x20 -#define JSON_ENSURE_ASCII 0x40 -#define JSON_SORT_KEYS 0x80 -#define JSON_PRESERVE_ORDER 0x100 -#define JSON_ENCODE_ANY 0x200 -#define JSON_ESCAPE_SLASH 0x400 - -typedef int (*json_dump_callback_t)(const char *buffer, size_t size, void *data); - -char *json_dumps(const json_t *json, size_t flags); -int json_dumpf(const json_t *json, FILE *output, size_t flags); -int json_dump_file(const json_t *json, const char *path, size_t flags); -int json_dump_callback(const json_t *json, json_dump_callback_t callback, void *data, size_t flags); - -/* custom memory allocation */ - -typedef void *(*json_malloc_t)(size_t); -typedef void (*json_free_t)(void *); - -void json_set_alloc_funcs(json_malloc_t malloc_fn, json_free_t free_fn); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/winbuild/sgminer.vcxproj b/winbuild/sgminer.vcxproj index 04d76819..bcab09ba 100644 --- a/winbuild/sgminer.vcxproj +++ b/winbuild/sgminer.vcxproj @@ -90,7 +90,7 @@ Disabled _M_AMD64;USE_SSE2;_AMD64_;WIN32;_WIN64;NDEBUG;_CONSOLE CompileAsCpp - $(ProjectDir)..;$(ProjectDir)dist\include\;%(AdditionalIncludeDirectories) + $(ProjectDir)..;$(ProjectDir)dist\include\;$(ProjectDir)..\compat\jansson-2.5\src\;%(AdditionalIncludeDirectories) true false false @@ -114,7 +114,7 @@ Disabled _M_AMD64;_AMD64_;WIN32;_WIN64;NDEBUG;_CONSOLE CompileAsCpp - $(ProjectDir)..;$(ProjectDir)dist\include\;%(AdditionalIncludeDirectories) + $(ProjectDir)..;$(ProjectDir)dist\include\;$(ProjectDir)..\compat\jansson-2.5\src\;%(AdditionalIncludeDirectories) true false false @@ -140,7 +140,7 @@ true _CONSOLE;PTW32_STATIC_LIB CompileAsCpp - $(ProjectDir)..;$(ProjectDir)dist\include\;%(AdditionalIncludeDirectories) + $(ProjectDir)..;$(ProjectDir)dist\include\;$(ProjectDir)..\compat\jansson-2.5\src\;%(AdditionalIncludeDirectories) false false StreamingSIMDExtensions2 @@ -166,7 +166,7 @@ true _M_AMD64;_AMD64_;WIN32;_WIN64;PTW32_STATIC_LIB CompileAsCpp - $(ProjectDir)..;$(ProjectDir)dist\include\;%(AdditionalIncludeDirectories) + $(ProjectDir)..;$(ProjectDir)dist\include\;$(ProjectDir)..\compat\jansson-2.5\src\;%(AdditionalIncludeDirectories) false false StreamingSIMDExtensions2 @@ -194,6 +194,16 @@ + + + + + + + + + + @@ -210,6 +220,11 @@ + + + + + diff --git a/winbuild/sgminer.vcxproj.filters b/winbuild/sgminer.vcxproj.filters index 6490d97d..4487f56d 100644 --- a/winbuild/sgminer.vcxproj.filters +++ b/winbuild/sgminer.vcxproj.filters @@ -9,6 +9,12 @@ {93995380-89BD-4b04-88EB-625FBE52EBFB} h;hh;hpp;hxx;hm;inl;inc;xsd + + {f88c4590-fe1f-4c7e-ac04-b7ee56ff742c} + + + {d18d03ff-8391-466a-9992-6701c4dbf0f3} + @@ -56,6 +62,36 @@ Source Files + + Libraries\jansson + + + Libraries\jansson + + + Libraries\jansson + + + Libraries\jansson + + + Libraries\jansson + + + Libraries\jansson + + + Libraries\jansson + + + Libraries\jansson + + + Libraries\jansson + + + Libraries\jansson + @@ -109,5 +145,20 @@ Header Files + + Libraries\jansson + + + Libraries\jansson + + + Libraries\jansson + + + Libraries\jansson + + + Libraries\jansson + \ No newline at end of file