]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
change intern methods handler without cast
authorBastian Dehn <hhaalo@arcor.de>
Sun, 18 Feb 2024 09:40:33 +0000 (10:40 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Sun, 18 Feb 2024 09:40:33 +0000 (10:40 +0100)
src/kds_s2000w_handler.c
src/kds_s2000w_handler_opts.c

index 4eb6680b1afb083853d70bc363f862cc4e91baaf..e4718af03a37b8b20aab9959c5f30ac948cbea08 100644 (file)
@@ -25,10 +25,9 @@ typedef struct {
 
 scan_status current_scan_status;
 
-void _get_current_metadata(void* handle)
+void _get_current_metadata(handler* h)
 {
        debug_printf(ALL, "get_current_metadata");
-       handler* h = (handler*) handle;
        resp = kds_s2000w_client_response_init();
        kds_s2000w_client_get_metadata(h->sessionid, current_scan_status.current_image_number, resp);
        if (resp->code != 200) {
@@ -110,10 +109,9 @@ void _get_current_metadata(void* handle)
        sleep(1);
 }
 
-void _delete_current_image(void* handle)
+void _delete_current_image(handler* h)
 {
        debug_printf(ALL, "delete_current_image");
-       handler* h = (handler*) handle;
        resp = kds_s2000w_client_response_init();
        kds_s2000w_client_delete_image(h->sessionid, current_scan_status.current_image_number, resp);
        kds_s2000w_client_response_free(resp);
@@ -121,10 +119,9 @@ void _delete_current_image(void* handle)
        sleep(1);
 }
 
-void _download_current_image(void* handle)
+void _download_current_image(handler* h)
 {
        debug_printf(ALL, "download_current_image");
-       handler* h = (handler*) handle;
        if (image.size > 0) {
                free(image.data);
                image.data = NULL;
@@ -141,10 +138,9 @@ void _download_current_image(void* handle)
        sleep(1);
 }
 
-void _get_current_scan_status(void* handle)
+void _get_current_scan_status(handler* h)
 {
        debug_printf(ALL, "get_current_scan_status");
-       handler* h = (handler*) handle;
        json_object* status_resp_obj = NULL;
        json_object* status_obj = NULL;
        json_object* status_value_obj = NULL;
index 2c71e58ae041427f8b88f892d4df760fd53e0987..6c056d6f9a2f50b390a6819792f56c54ab0f1be8 100644 (file)
@@ -35,9 +35,8 @@ void _write_int_value_to_json(json_object* value_object, void* value)
        json_object_set_int(value_object, *int_value_ptr);
 }
 
-void _load_options(void* handle)
+void _load_options(handler* h)
 {
-       handler* h = (handler*) handle;
        json_object_put(resp_config);
        resp_config = NULL;