[Pcsclite-cvs-commit] r4985 - in /trunk/PCSC/src: simclist.c simclist.h
rousseau at users.alioth.debian.org
rousseau at users.alioth.debian.org
Wed Jun 9 11:21:20 UTC 2010
Author: rousseau
Date: Wed Jun 9 11:21:17 2010
New Revision: 4985
URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=4985
Log:
update to version version 1.4.4rc4 Apr 2010
Modified:
trunk/PCSC/src/simclist.c
trunk/PCSC/src/simclist.h
Modified: trunk/PCSC/src/simclist.c
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/simclist.c?rev=4985&op=diff
==============================================================================
--- trunk/PCSC/src/simclist.c (original)
+++ trunk/PCSC/src/simclist.c Wed Jun 9 11:21:17 2010
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007,2008,2009 Mij <mij at bitchx.it>
+ * Copyright (c) 2007,2008,2009,2010 Mij <mij at bitchx.it>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -18,6 +18,8 @@
/*
* SimCList library. See http://mij.oltrelinux.com/devel/simclist
*/
+
+/* SimCList implementation, version 1.4.4rc4 */
#include <stdlib.h>
#include <string.h>
@@ -448,11 +450,11 @@
pos = list_locate(l, data);
if (pos < 0)
- return pos;
+ return -1;
r = list_delete_at(l, pos);
if (r < 0)
- return r;
+ return -1;
assert(list_repOk(l));
@@ -1072,6 +1074,10 @@
header.elemlen = 0;
header.totlistlen = 0;
x = l->head_sentinel;
+ if (lseek(fd, SIMCLIST_DUMPFORMAT_HEADERLEN, SEEK_SET) < 0) {
+ /* errno set by lseek() */
+ return -1;
+ }
/* restart from the beginning */
continue;
}
@@ -1330,7 +1336,7 @@
int list_comparator_string(const void *a, const void *b) { return strcmp((const char *)b, (const char *)a); }
/* ready-made metric functions */
-#define SIMCLIST_METER(type) size_t list_meter_##type(const void *el) { (void)el; return sizeof(type); }
+#define SIMCLIST_METER(type) size_t list_meter_##type(const void *el) { if (el) { /* kill compiler whinge */ } return sizeof(type); }
SIMCLIST_METER(int8_t)
SIMCLIST_METER(int16_t)
Modified: trunk/PCSC/src/simclist.h
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/simclist.h?rev=4985&op=diff
==============================================================================
--- trunk/PCSC/src/simclist.h (original)
+++ trunk/PCSC/src/simclist.h Wed Jun 9 11:21:17 2010
@@ -429,16 +429,17 @@
/**
* expunge the first found given element from the list.
*
- * @warning Requires a comparator function to be set for the list.
- *
* Inspects the given list looking for the given element; if the element
* is found, it is removed. Only the first occurence is removed.
- * Elements are inspected comparing references if a comparator has not been
- * set. Otherwise, the comparator is used to find the element.
+ * If a comparator function was not set, elements are compared by reference.
+ * Otherwise, the comparator is used to match the element.
*
* @param l list to operate
* @param data reference of the element to search for
* @return 0 on success. Negative value on failure
+ *
+ * @see list_attributes_comparator()
+ * @see list_delete_at()
*/
int list_delete(list_t *restrict l, const void *data);
More information about the Pcsclite-cvs-commit
mailing list