summaryrefslogtreecommitdiff
path: root/sanei/sanei_wire.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2024-03-03 09:54:51 +0100
committerJörg Frings-Fürst <debian@jff.email>2024-03-03 09:54:51 +0100
commit44916ca6d75e0b5f258a098a50d659f31c6625fd (patch)
tree2e51a12ae43b3def9e55d3f2c9ca60d2032ad45c /sanei/sanei_wire.c
parent84357741a6a6e6430f199b2c3f7498e0e97da9ad (diff)
New upstream version 1.3.0upstream/1.3.0
Diffstat (limited to 'sanei/sanei_wire.c')
-rw-r--r--sanei/sanei_wire.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/sanei/sanei_wire.c b/sanei/sanei_wire.c
index 53bf6ba..0d4f081 100644
--- a/sanei/sanei_wire.c
+++ b/sanei/sanei_wire.c
@@ -57,11 +57,11 @@ sanei_w_space (Wire * w, size_t howmuch)
int fd = w->io.fd;
ssize_t nread, nwritten;
- DBG (3, "sanei_w_space: %lu bytes for wire %d\n", (u_long) howmuch, fd);
+ DBG (3, "sanei_w_space: %zu bytes for wire %d\n", howmuch, fd);
if (howmuch > w->buffer.size)
- DBG (2, "sanei_w_space: bigger than buffer (%lu bytes), "
- "may be flush()\n", (u_long) w->buffer.size);
+ DBG (2, "sanei_w_space: bigger than buffer (%zu bytes), "
+ "may be flush()\n", w->buffer.size);
if (w->status != 0)
{
@@ -72,15 +72,15 @@ sanei_w_space (Wire * w, size_t howmuch)
if (w->buffer.curr + howmuch > w->buffer.end)
{
- DBG (4, "sanei_w_space: free buffer size is %lu\n",
- (u_long) (w->buffer.end - w->buffer.curr));
+ DBG (4, "sanei_w_space: free buffer size is %zu\n",
+ (w->buffer.end - w->buffer.curr));
switch (w->direction)
{
case WIRE_ENCODE:
nbytes = w->buffer.curr - w->buffer.start;
w->buffer.curr = w->buffer.start;
- DBG (4, "sanei_w_space: ENCODE: sending %lu bytes\n",
- (u_long) nbytes);
+ DBG (4, "sanei_w_space: ENCODE: sending %zu bytes\n",
+ nbytes);
while (nbytes > 0)
{
nwritten = (*w->io.write) (fd, w->buffer.curr, nbytes);
@@ -95,8 +95,8 @@ sanei_w_space (Wire * w, size_t howmuch)
}
w->buffer.curr = w->buffer.start;
w->buffer.end = w->buffer.start + w->buffer.size;
- DBG (4, "sanei_w_space: ENCODE: free buffer is now %lu\n",
- (u_long) w->buffer.size);
+ DBG (4, "sanei_w_space: ENCODE: free buffer is now %zu\n",
+ w->buffer.size);
break;
case WIRE_DECODE:
@@ -110,8 +110,8 @@ sanei_w_space (Wire * w, size_t howmuch)
if (left_over)
{
- DBG (4, "sanei_w_space: DECODE: %lu bytes left in buffer\n",
- (u_long) left_over);
+ DBG (4, "sanei_w_space: DECODE: %zu bytes left in buffer\n",
+ left_over);
memmove (w->buffer.start, w->buffer.curr, left_over);
}
w->buffer.curr = w->buffer.start;
@@ -135,8 +135,8 @@ sanei_w_space (Wire * w, size_t howmuch)
w->buffer.end += nread;
}
while (left_over < howmuch);
- DBG (4, "sanei_w_space: DECODE: %lu bytes read\n",
- (u_long) (w->buffer.end - w->buffer.start));
+ DBG (4, "sanei_w_space: DECODE: %zu bytes read\n",
+ (size_t)(w->buffer.end - w->buffer.start));
break;
case WIRE_FREE:
@@ -161,8 +161,8 @@ sanei_w_array (Wire * w, SANE_Word * len_ptr, void **v,
char *val;
int i;
- DBG (3, "sanei_w_array: wire %d, elements of size %lu\n", w->io.fd,
- (u_long) element_size);
+ DBG (3, "sanei_w_array: wire %d, elements of size %zu\n", w->io.fd,
+ element_size);
if (w->direction == WIRE_FREE)
{
@@ -250,8 +250,8 @@ sanei_w_ptr (Wire * w, void **v, WireCodecFunc w_value, size_t value_size)
{
SANE_Word is_null;
- DBG (3, "sanei_w_ptr: wire %d, value pointer at is %lu bytes\n", w->io.fd,
- (u_long) value_size);
+ DBG (3, "sanei_w_ptr: wire %d, value pointer at is %zu bytes\n", w->io.fd,
+ value_size);
if (w->direction == WIRE_FREE)
{
@@ -583,8 +583,8 @@ sanei_w_set_dir (Wire * w, WireDirection dir)
w->direction == WIRE_ENCODE ? "ENCODE" :
(w->direction == WIRE_DECODE ? "DECODE" : "FREE"));
if (w->direction == WIRE_DECODE && w->buffer.curr != w->buffer.end)
- DBG (1, "sanei_w_set_dir: WARNING: will delete %lu bytes from buffer\n",
- (u_long) (w->buffer.end - w->buffer.curr));
+ DBG (1, "sanei_w_set_dir: WARNING: will delete %zu bytes from buffer\n",
+ (size_t) (w->buffer.end - w->buffer.curr));
flush (w);
w->direction = dir;
DBG (4, "sanei_w_set_dir: direction changed\n");