avoid to use cpp in code
[psensor.git] / src / server / server.c
index 15c622e..3db6828 100644 (file)
@@ -81,7 +81,7 @@ static pthread_mutex_t mutex;
 
 static int server_stop_requested;
 
-static void print_version()
+static void print_version(void)
 {
        printf("psensor-server %s\n", VERSION);
        printf(_("Copyright (C) %s jeanfi@gmail.com\n"
@@ -92,7 +92,7 @@ static void print_version()
               "2010-2012");
 }
 
-static void print_help()
+static void print_help(void)
 {
        printf(_("Usage: %s [OPTION]...\n"), program_name);
 
@@ -245,12 +245,13 @@ static struct MHD_Response *create_response_file(const char *nurl,
 static struct MHD_Response *
 create_response(const char *nurl, const char *method, unsigned int *rp_code)
 {
+       char *page, *fpath;
        struct MHD_Response *resp = NULL;
 
        if (!strncmp(nurl, URL_BASE_API_1_1, strlen(URL_BASE_API_1_1))) {
                resp = create_response_api(nurl, method, rp_code);
        } else {
-               char *fpath = get_path(nurl, server_data.www_dir);
+               fpath = get_path(nurl, server_data.www_dir);
 
                resp = create_response_file(nurl, method, rp_code, fpath);
 
@@ -260,7 +261,7 @@ create_response(const char *nurl, const char *method, unsigned int *rp_code)
        if (resp)
                return resp;
 
-       char *page = strdup(PAGE_NOT_FOUND);
+       page = strdup(PAGE_NOT_FOUND);
        *rp_code = MHD_HTTP_NOT_FOUND;
 
        return MHD_create_response_from_data(strlen(page),
@@ -275,7 +276,8 @@ static int cbk_http_request(void *cls,
                            const char *method,
                            const char *version,
                            const char *upload_data,
-                           size_t *upload_data_size, void **ptr)
+                           size_t *upload_data_size,
+                           void **ptr)
 {
        static int dummy;
        struct MHD_Response *response;
@@ -463,7 +465,7 @@ int main(int argc, char *argv[])
        psensor_free(server_data.cpu_usage);
 #endif
        free(server_data.www_dir);
-       sensors_cleanup();
+       lmsensor_cleanup();
 
 #ifdef HAVE_GTOP
        sysinfo_cleanup();