Commit afcbeeac authored by Filippos Giannakos's avatar Filippos Giannakos

xseg: Fix compilation warnings

parent 2d1c5e43
......@@ -126,6 +126,7 @@ static void *xcache_get_entry(struct xcache *cache, xcache_handler h)
* Return a pointer to a NULL terminated string holding the name of the
* associated cache entry.
*/
/*
static char *xcache_get_name(struct xcache *cache, xcache_handler h)
{
xqindex idx = (xqindex)h;
......@@ -135,6 +136,7 @@ static char *xcache_get_name(struct xcache *cache, xcache_handler h)
return cache->nodes[idx].name;
}
*/
int xcache_init(struct xcache *cache, uint32_t xcache_size,
struct xcache_ops *ops, uint32_t flags, void *priv);
......
......@@ -1507,6 +1507,7 @@ int xseg_resize_request (struct xseg *xseg, struct xseg_request *req,
return xseg_prep_request(xseg, req, new_targetlen, new_datalen);
}
#if 0
static void __update_timestamp(struct xseg_request *xreq)
{
struct timeval tv;
......@@ -1528,6 +1529,7 @@ static void __update_timestamp(struct xseg_request *xreq)
xreq->timestamp.tv_sec = tv.tv_sec;
xreq->timestamp.tv_usec = tv.tv_usec;
}
#endif
//FIXME should we add NON_BLOCK flag?
xport xseg_submit (struct xseg *xseg, struct xseg_request *xreq,
......
......@@ -388,7 +388,7 @@ int posixfd_init_signal_desc(struct xseg *xseg, void *sd)
return -1;
psd->signal_file[0] = 0;
/* POSIXFD_FILENAME_LEN = 2 * sizeof(void *) */
hexlify(&sd, POSIXFD_FILENAME_LEN / 2, psd->signal_file);
hexlify((unsigned char *)&sd, POSIXFD_FILENAME_LEN / 2, psd->signal_file);
psd->flag = 0;
psd->fd = -1;
......
......@@ -259,6 +259,7 @@ static xcache_handler __xcache_lookup_rm(struct xcache *cache, char *name)
return __table_lookup(cache->rm_entries, name);
}
/*
static xcache_handler __xcache_lookup_and_get_rm(struct xcache *cache, char *name)
{
xcache_handler h;
......@@ -270,6 +271,7 @@ static xcache_handler __xcache_lookup_and_get_rm(struct xcache *cache, char *nam
return h;
}
*/
static xcache_handler __xcache_lookup_entries(struct xcache *cache, char *name)
{
......
......@@ -88,21 +88,21 @@ int test_string(xhashidx loops)
int ret;
xhashidx r;
//printf("insert(%lx, %lx)\n", i, -i);
rr = xhash_insert(h, string[i], i);
rr = xhash_insert(h, (xhashidx)string[i], i);
if (rr == -XHASH_ERESIZE){
h = my_resize(h, xhash_grow_size_shift(h));
rr = xhash_insert(h, string[i], i);
rr = xhash_insert(h, (xhashidx)string[i], i);
if (rr != 0)
printf("resize string insert error in %lx: %lx != %lx\n", i, r, i);
}
ret = xhash_lookup(h, string[i], &r);
ret = xhash_lookup(h, (xhashidx)string[i], &r);
if (ret || (r != i)) {
printf("string insert error in %lx (ret: %d): returned val %lx, expected val %lx\n ", i, ret, r, i);
}
//printf(" ->got(%lx, %lx)\n", i, r);
}
for (i = 10; i < loops; i++) {
int ret = xhash_lookup(h, string[i], &v);
int ret = xhash_lookup(h, (xhashidx)string[i], &v);
//printf(" ->got(%lu, %lu)\n", i, v);
if (ret || (i != v)) {
printf("string error in %lu: %lu != %lu\n", i, i, v);
......@@ -113,14 +113,14 @@ int test_string(xhashidx loops)
int ret;
xhashidx r;
//printf("insert(%lx, %lx)\n", i, -i);
rr = xhash_delete(h, string[i]);
rr = xhash_delete(h, (xhashidx)string[i]);
if (rr == -XHASH_ERESIZE){
h = my_resize(h, xhash_shrink_size_shift(h));
rr = xhash_delete(h, string[i]);
rr = xhash_delete(h, (xhashidx)string[i]);
if (rr != 0)
printf("resize string delele error in %lx: %lx != %lx\n", i, r, i);
}
ret = xhash_lookup(h, string[i], &r);
ret = xhash_lookup(h, (xhashidx)string[i], &r);
if (!ret) {
printf("string delete error in %lx: %lx != %lx\n", i, r, i);
}
......@@ -154,7 +154,7 @@ int test_string2()
rr = xhash_insert(h, (xhashidx) string[i], (xhashidx) i);
if (rr == -XHASH_ERESIZE){
h = my_resize(h, xhash_grow_size_shift(h));
rr = xhash_insert(h, string[i], (xhashidx) i);
rr = xhash_insert(h, (xhashidx)string[i], (xhashidx) i);
if (rr != 0)
printf("resize string insert error in %lx: %lx != %lx\n", i, r, i);
}
......
......@@ -16,6 +16,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdlib.h>
#include <string.h>
#include <xseg/xheap.h>
#include <stdint.h>
#include <pthread.h>
......
......@@ -16,6 +16,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <xseg/xobj.h>
#include <pthread.h>
#include <sys/time.h>
......
......@@ -52,7 +52,7 @@ int test1(unsigned long n)
for (i = 0; i < n; i++) {
works[i].job_fn = jobfn;
works[i].job = 1;
works[i].job = (void *)1;
}
for (i = 0; i < n; i++) {
......@@ -83,7 +83,7 @@ void *thread_test(void *arg)
for (i = 0; i < n; i++) {
works[i].job_fn = jobfn;
works[i].job = targ->num;
works[i].job = (void *)targ->num;
}
for (i = 0; i < n; i++) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment