Code Review
/
src
/
app-framework-main.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Remove use of deprecated readdir_r
[src/app-framework-main.git]
/
src
/
wgt-config.c
diff --git
a/src/wgt-config.c
b/src/wgt-config.c
index
04548c3
..
453f295
100644
(file)
--- a/
src/wgt-config.c
+++ b/
src/wgt-config.c
@@
-1,5
+1,7
@@
/*
/*
- Copyright 2015 IoT.bzh
+ Copyright 2015, 2016, 2017 IoT.bzh
+
+ author: José Bollo <jose.bollo@iot.bzh>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@
-16,7
+18,6
@@
#include <unistd.h>
#include <string.h>
#include <unistd.h>
#include <string.h>
-#include <syslog.h>
#include <assert.h>
#include <errno.h>
#include <assert.h>
#include <errno.h>
@@
-24,6
+25,7
@@
#include <libxml/tree.h>
#include <libxml/uri.h>
#include <libxml/tree.h>
#include <libxml/uri.h>
+#include "verbose.h"
#include "wgt.h"
#include "wgt-config.h"
#include "wgt.h"
#include "wgt-config.h"
@@
-71,10
+73,10
@@
static xmlNodePtr first(const char *type)
return next(xmlDocGetRootElement(configxml)->children, type);
}
return next(xmlDocGetRootElement(configxml)->children, type);
}
-static int scorelang(xmlNodePtr node)
+static
unsigned
int scorelang(xmlNodePtr node)
{
char *lang = xmlNodeGetLang(node);
{
char *lang = xmlNodeGetLang(node);
- int score = wgt_locales_score(configwgt, lang);
+
unsigned
int score = wgt_locales_score(configwgt, lang);
xmlFree(lang);
return score;
}
xmlFree(lang);
return score;
}
@@
-82,7
+84,7
@@
static int scorelang(xmlNodePtr node)
static xmlNodePtr element_based_localisation(const char *type)
{
xmlNodePtr resu, elem;
static xmlNodePtr element_based_localisation(const char *type)
{
xmlNodePtr resu, elem;
- int sr, s;
+
unsigned
int sr, s;
resu = first(type);
if (resu) {
resu = first(type);
if (resu) {
@@
-115,13
+117,13
@@
int wgt_config_open(struct wgt *wgt)
assert(!configxml);
fd = wgt_open_read(wgt, wgt_config_string_xml_file);
if (fd < 0) {
assert(!configxml);
fd = wgt_open_read(wgt, wgt_config_string_xml_file);
if (fd < 0) {
-
syslog(LOG_ERR,
"can't open config file %s", wgt_config_string_xml_file);
+
ERROR(
"can't open config file %s", wgt_config_string_xml_file);
return fd;
}
configxml = xmlReadFd(fd, wgt_config_string_xml_file, NULL, 0);
close(fd);
if (configxml == NULL) {
return fd;
}
configxml = xmlReadFd(fd, wgt_config_string_xml_file, NULL, 0);
close(fd);
if (configxml == NULL) {
-
syslog(LOG_ERR,
"xml parse of config file %s failed", wgt_config_string_xml_file);
+
ERROR(
"xml parse of config file %s failed", wgt_config_string_xml_file);
return -1;
}
assert(xmlDocGetRootElement(configxml));
return -1;
}
assert(xmlDocGetRootElement(configxml));