diff options
author | Julien BLACHE <jblache@debian.org> | 2007-02-27 22:22:40 +0100 |
---|---|---|
committer | Mattia Rizzolo <mattia@mapreri.org> | 2014-10-03 14:05:34 +0000 |
commit | 4d8384e7b116e3eb11cc3df9151c8554dbca95fc (patch) | |
tree | f049f1240de8a8a971a621a4a3891d5eab2839a1 /src/xsane-rc-io.c | |
parent | 92f35807f68b30405639d4e0a95f748b6bdb793f (diff) | |
parent | 129ed4b29e21fdb8bda3bee89c3e5d8cca6ba749 (diff) |
Imported Debian patch 0.993-1debian/0.993-1
Diffstat (limited to 'src/xsane-rc-io.c')
-rw-r--r-- | src/xsane-rc-io.c | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/src/xsane-rc-io.c b/src/xsane-rc-io.c index 4a0af86..39a29ef 100644 --- a/src/xsane-rc-io.c +++ b/src/xsane-rc-io.c @@ -3,7 +3,7 @@ xsane-rc-io.c Oliver Rauch <Oliver.Rauch@rauch-domain.de> - Copyright (C) 1998-2005 Oliver Rauch + Copyright (C) 1998-2007 Oliver Rauch This file is part of the XSANE package. This program is free software; you can redistribute it and/or modify @@ -119,7 +119,7 @@ void xsane_rc_io_w_void(Wire *w) /* ---------------------------------------------------------------------------------------------------------------- */ -void xsane_rc_io_w_array(Wire *w, SANE_Word *len_ptr, void **v, WireCodecFunc w_element, size_t element_size) +void xsane_rc_io_w_array(Wire *w, SANE_Word *len_ptr, char **v, WireCodecFunc w_element, size_t element_size) { SANE_Word len; char *val; @@ -180,7 +180,7 @@ void xsane_rc_io_w_array(Wire *w, SANE_Word *len_ptr, void **v, WireCodecFunc w_ /* ---------------------------------------------------------------------------------------------------------------- */ -void xsane_rc_io_w_ptr(Wire *w, void **v, WireCodecFunc w_value, size_t value_size) +void xsane_rc_io_w_ptr(Wire *w, char **v, WireCodecFunc w_value, size_t value_size) { SANE_Word is_null; @@ -352,7 +352,7 @@ void xsane_rc_io_w_device_ptr(Wire *w, SANE_Device **v) { DBG(DBG_wire, "xsane_rc_io_w_device_ptr\n"); - xsane_rc_io_w_ptr(w, (void **) v, (WireCodecFunc) xsane_rc_io_w_device, sizeof (**v)); + xsane_rc_io_w_ptr(w, (char **) v, (WireCodecFunc) xsane_rc_io_w_device, sizeof (**v)); } /* ---------------------------------------------------------------------------------------------------------------- */ @@ -360,6 +360,7 @@ void xsane_rc_io_w_device_ptr(Wire *w, SANE_Device **v) void xsane_rc_io_w_option_descriptor(Wire *w, SANE_Option_Descriptor *v) { SANE_Word len; + char *data_ptr = NULL; DBG(DBG_wire, "xsane_rc_io_w_option_descriptor\n"); @@ -378,7 +379,8 @@ void xsane_rc_io_w_option_descriptor(Wire *w, SANE_Option_Descriptor *v) break; case SANE_CONSTRAINT_RANGE: - xsane_rc_io_w_ptr(w, (void **) &v->constraint.range, (WireCodecFunc) xsane_rc_io_w_range, sizeof (SANE_Range)); + data_ptr = (char *) v->constraint.range; + xsane_rc_io_w_ptr(w, &data_ptr, (WireCodecFunc) xsane_rc_io_w_range, sizeof (SANE_Range)); break; case SANE_CONSTRAINT_WORD_LIST: @@ -386,16 +388,18 @@ void xsane_rc_io_w_option_descriptor(Wire *w, SANE_Option_Descriptor *v) { len = v->constraint.word_list[0] + 1; } - xsane_rc_io_w_array(w, &len, (void **) &v->constraint.word_list, w->codec.w_word, sizeof(SANE_Word)); + data_ptr = (char *) v->constraint.word_list; + xsane_rc_io_w_array(w, &len, &data_ptr, w->codec.w_word, sizeof(SANE_Word)); break; case SANE_CONSTRAINT_STRING_LIST: if (w->direction != WIRE_DECODE) - { - for (len = 0; v->constraint.string_list[len]; ++len); - ++len; /* send NULL string, too */ - } - xsane_rc_io_w_array(w, &len, (void **) &v->constraint.string_list, w->codec.w_string, sizeof(SANE_String)); + { + for (len = 0; v->constraint.string_list[len]; ++len); + ++len; /* send NULL string, too */ + } + data_ptr = (char *) v->constraint.string_list; + xsane_rc_io_w_array(w, &len, &data_ptr, w->codec.w_string, sizeof(SANE_String)); break; } } @@ -406,7 +410,7 @@ void xsane_rc_io_w_option_descriptor_ptr(Wire *w, SANE_Option_Descriptor **v) { DBG(DBG_wire, "xsane_rc_io_w_option_descriptor_ptr\n"); - xsane_rc_io_w_ptr(w, (void **) v, (WireCodecFunc) xsane_rc_io_w_option_descriptor, sizeof (**v)); + xsane_rc_io_w_ptr(w, (char **) v, (WireCodecFunc) xsane_rc_io_w_option_descriptor, sizeof (**v)); } /* ---------------------------------------------------------------------------------------------------------------- */ |