Skip to content

Commit

Permalink
Fixed gcc warning.
Browse files Browse the repository at this point in the history
The original patch had converted chunk to int, but after
checking about, it seems better to keep that a size_t and simply
remove the typedef.

This is more c99, and also requires the addition of stddef.h.
http://stackoverflow.com/questions/3597743/where-is-ptrdiff-t-defined-in-c
  • Loading branch information
Aliaksey Kandratsenka authored and ingenthr committed Jan 5, 2011
1 parent e7bc7eb commit 711139b
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions libmemc.c
Expand Up @@ -39,6 +39,7 @@
#include <unistd.h>
#include <errno.h>
#include <stdlib.h>
#include <stddef.h>
#include <string.h>
#include <stdio.h>
#include <assert.h>
Expand Down Expand Up @@ -797,9 +798,6 @@ static int textual_get(struct Server* server, struct Item* item) {
server_disconnect(server);
return -1;
}
#ifndef __sun
typedef size_t ptrdiff_t;
#endif
ptrdiff_t headsize = ptr - server->buffer;
size_t chunk = nread - headsize;

Expand Down

0 comments on commit 711139b

Please sign in to comment.