Try to fix most warnings in the OBS builds (#4284)
This commit is contained in:
parent
3755f5c18e
commit
e58cecbf06
@ -38,7 +38,8 @@ const char *cJSON_GetErrorPtr(void) {return ep;}
|
|||||||
|
|
||||||
static int cJSON_strcasecmp(const char *s1,const char *s2)
|
static int cJSON_strcasecmp(const char *s1,const char *s2)
|
||||||
{
|
{
|
||||||
if (!s1) return (s1==s2)?0:1;if (!s2) return 1;
|
if (!s1) return (s1==s2)?0:1;
|
||||||
|
if (!s2) return 1;
|
||||||
for(; tolower(*s1) == tolower(*s2); ++s1, ++s2) if(*s1 == 0) return 0;
|
for(; tolower(*s1) == tolower(*s2); ++s1, ++s2) if(*s1 == 0) return 0;
|
||||||
return tolower(*(const unsigned char *)s1) - tolower(*(const unsigned char *)s2);
|
return tolower(*(const unsigned char *)s1) - tolower(*(const unsigned char *)s2);
|
||||||
}
|
}
|
||||||
@ -505,7 +506,8 @@ static char *print_object(cJSON *item,int depth,int fmt)
|
|||||||
*ptr++=':';if (fmt) *ptr++='\t';
|
*ptr++=':';if (fmt) *ptr++='\t';
|
||||||
strcpy(ptr,entries[i]);ptr+=strlen(entries[i]);
|
strcpy(ptr,entries[i]);ptr+=strlen(entries[i]);
|
||||||
if (i!=numentries-1) *ptr++=',';
|
if (i!=numentries-1) *ptr++=',';
|
||||||
if (fmt) *ptr++='\n';*ptr=0;
|
if (fmt) *ptr++='\n';
|
||||||
|
*ptr=0;
|
||||||
cJSON_free(names[i]);cJSON_free(entries[i]);
|
cJSON_free(names[i]);cJSON_free(entries[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -531,8 +533,15 @@ void cJSON_AddItemToObject(cJSON *object,const char *string,cJSON *item) {if (
|
|||||||
void cJSON_AddItemReferenceToArray(cJSON *array, cJSON *item) {cJSON_AddItemToArray(array,create_reference(item));}
|
void cJSON_AddItemReferenceToArray(cJSON *array, cJSON *item) {cJSON_AddItemToArray(array,create_reference(item));}
|
||||||
void cJSON_AddItemReferenceToObject(cJSON *object,const char *string,cJSON *item) {cJSON_AddItemToObject(object,string,create_reference(item));}
|
void cJSON_AddItemReferenceToObject(cJSON *object,const char *string,cJSON *item) {cJSON_AddItemToObject(object,string,create_reference(item));}
|
||||||
|
|
||||||
cJSON *cJSON_DetachItemFromArray(cJSON *array,int which) {cJSON *c=array->child;while (c && which>0) c=c->next,which--;if (!c) return 0;
|
cJSON *cJSON_DetachItemFromArray(cJSON *array,int which) {
|
||||||
if (c->prev) c->prev->next=c->next;if (c->next) c->next->prev=c->prev;if (c==array->child) array->child=c->next;c->prev=c->next=0;return c;}
|
cJSON *c=array->child;
|
||||||
|
while (c && which>0) c=c->next,which--;
|
||||||
|
if (!c) return 0;
|
||||||
|
if (c->prev) c->prev->next=c->next;
|
||||||
|
if (c->next) c->next->prev=c->prev;
|
||||||
|
if (c==array->child) array->child=c->next;c->prev=c->next=0;
|
||||||
|
return c;
|
||||||
|
}
|
||||||
void cJSON_DeleteItemFromArray(cJSON *array,int which) {cJSON_Delete(cJSON_DetachItemFromArray(array,which));}
|
void cJSON_DeleteItemFromArray(cJSON *array,int which) {cJSON_Delete(cJSON_DetachItemFromArray(array,which));}
|
||||||
cJSON *cJSON_DetachItemFromObject(cJSON *object,const char *string) {int i=0;cJSON *c=object->child;while (c && cJSON_strcasecmp(c->string,string)) i++,c=c->next;if (c) return cJSON_DetachItemFromArray(object,i);return 0;}
|
cJSON *cJSON_DetachItemFromObject(cJSON *object,const char *string) {int i=0;cJSON *c=object->child;while (c && cJSON_strcasecmp(c->string,string)) i++,c=c->next;if (c) return cJSON_DetachItemFromArray(object,i);return 0;}
|
||||||
void cJSON_DeleteItemFromObject(cJSON *object,const char *string) {cJSON_Delete(cJSON_DetachItemFromObject(object,string));}
|
void cJSON_DeleteItemFromObject(cJSON *object,const char *string) {cJSON_Delete(cJSON_DetachItemFromObject(object,string));}
|
||||||
|
@ -3851,7 +3851,7 @@ float CLASS foveon_avg (short *pix, int range[2], float cfilt)
|
|||||||
short * CLASS foveon_make_curve (double max, double mul, double filt)
|
short * CLASS foveon_make_curve (double max, double mul, double filt)
|
||||||
{
|
{
|
||||||
short *curve;
|
short *curve;
|
||||||
unsigned i, size;
|
size_t i, size;
|
||||||
double x;
|
double x;
|
||||||
|
|
||||||
if (!filt) filt = 0.8;
|
if (!filt) filt = 0.8;
|
||||||
|
@ -373,7 +373,7 @@ Glib::ustring BatchQueue::getTempFilenameForParams( const Glib::ustring &filenam
|
|||||||
{
|
{
|
||||||
timeval tv;
|
timeval tv;
|
||||||
gettimeofday(&tv, nullptr);
|
gettimeofday(&tv, nullptr);
|
||||||
char mseconds[4];
|
char mseconds[11];
|
||||||
sprintf(mseconds, "%d", (int)(tv.tv_usec / 1000));
|
sprintf(mseconds, "%d", (int)(tv.tv_usec / 1000));
|
||||||
time_t rawtime;
|
time_t rawtime;
|
||||||
struct tm *timeinfo;
|
struct tm *timeinfo;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user