Skip to content

Commit 2eeb5f4

Browse files
committed
change ssize_t to size_t in utarray/string
1 parent cd61f07 commit 2eeb5f4

File tree

4 files changed

+34
-8
lines changed

4 files changed

+34
-8
lines changed

doc/ChangeLog.html

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -784,6 +784,33 @@ <h1>uthash ChangeLog</h1>
784784
</div>
785785
</div>
786786
<div class="sect1">
787+
<h2 id="_version_1_9_9_1_2014_00_00">Version 1.9.9.1 (2014-00-00)</h2>
788+
<div class="sectionbody">
789+
<div class="ulist"><ul>
790+
<li>
791+
<p>
792+
switch ssize_t types in utarray/utstring to size_t (thanks, Hong Xu!)
793+
</p>
794+
</li>
795+
<li>
796+
<p>
797+
fix utstring pointer math on &gt;4GB strings (thanks, Thomas Bottesch!)
798+
</p>
799+
</li>
800+
<li>
801+
<p>
802+
change FNV hash to FNV-1a varation (thanks, dwest1975!)
803+
</p>
804+
</li>
805+
<li>
806+
<p>
807+
fix bug in HASH_REPLACE_STR (thanks, Ilya Kaliman!)
808+
</p>
809+
</li>
810+
</ul></div>
811+
</div>
812+
</div>
813+
<div class="sect1">
787814
<h2 id="_version_1_9_9_2014_02_25">Version 1.9.9 (2014-02-25)</h2>
788815
<div class="sectionbody">
789816
<div class="ulist"><ul>
@@ -1505,7 +1532,7 @@ <h2 id="_version_1_0_2006_06_02">Version 1.0 (2006-06-02)</h2>
15051532
<div id="footnotes"><hr /></div>
15061533
<div id="footer">
15071534
<div id="footer-text">
1508-
Last updated 2014-02-25 21:25:49 EST
1535+
Last updated 2014-07-04 09:48:31 EDT
15091536
</div>
15101537
</div>
15111538
</body>

doc/ChangeLog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Click to return to the link:index.html[uthash home page].
55

66
Version 1.9.9.1 (2014-00-00)
77
--------------------------
8+
* switch ssize_t types in utarray/utstring to size_t (thanks, Hong Xu!)
89
* fix utstring pointer math on >4GB strings (thanks, Thomas Bottesch!)
910
* change FNV hash to FNV-1a varation (thanks, dwest1975!)
1011
* fix bug in HASH_REPLACE_STR (thanks, Ilya Kaliman!)

src/utarray.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3535
#endif
3636

3737
#include <stddef.h> /* size_t */
38-
#include <sys/types.h> /* ssize_t */
3938
#include <string.h> /* memset, etc */
4039
#include <stdlib.h> /* exit */
4140

@@ -214,7 +213,7 @@ typedef struct {
214213
#define utarray_next(a,e) (((e)==NULL) ? utarray_front(a) : ((((a)->i) > (utarray_eltidx(a,e)+1)) ? _utarray_eltptr(a,utarray_eltidx(a,e)+1) : NULL))
215214
#define utarray_prev(a,e) (((e)==NULL) ? utarray_back(a) : ((utarray_eltidx(a,e) > 0) ? _utarray_eltptr(a,utarray_eltidx(a,e)-1) : NULL))
216215
#define utarray_back(a) (((a)->i) ? (_utarray_eltptr(a,(a)->i-1)) : NULL)
217-
#define utarray_eltidx(a,e) (((char*)(e) >= (char*)((a)->d)) ? (((char*)(e) - (char*)((a)->d))/(ssize_t)(a)->icd.sz) : -1)
216+
#define utarray_eltidx(a,e) (((char*)(e) >= (char*)((a)->d)) ? (((char*)(e) - (char*)((a)->d))/(size_t)(a)->icd.sz) : -1)
218217

219218
/* last we pre-define a few icd for common utarrays of ints and strings */
220219
static void utarray_str_cpy(void *dst, const void *src) {

src/utstring.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3535
#endif
3636

3737
#include <stdlib.h>
38-
#include <sys/types.h> /* ssize_t */
3938
#include <string.h>
4039
#include <stdarg.h>
4140
#define oom() exit(-1)
@@ -156,7 +155,7 @@ _UNUSED_ static void utstring_printf(UT_string *s, const char *fmt, ...) {
156155
/* Build KMP table from left to right. */
157156
_UNUSED_ static void _utstring_BuildTable(
158157
const char *P_Needle,
159-
ssize_t P_NeedleLen,
158+
size_t P_NeedleLen,
160159
long *P_KMP_Table)
161160
{
162161
long i, j;
@@ -196,7 +195,7 @@ _UNUSED_ static void _utstring_BuildTable(
196195
/* Build KMP table from right to left. */
197196
_UNUSED_ static void _utstring_BuildTableR(
198197
const char *P_Needle,
199-
ssize_t P_NeedleLen,
198+
size_t P_NeedleLen,
200199
long *P_KMP_Table)
201200
{
202201
long i, j;
@@ -305,7 +304,7 @@ _UNUSED_ static long utstring_find(
305304
UT_string *s,
306305
long P_StartPosition, /* Start from 0. -1 means last position. */
307306
const char *P_Needle,
308-
ssize_t P_NeedleLen)
307+
size_t P_NeedleLen)
309308
{
310309
long V_StartPosition;
311310
long V_HaystackLen;
@@ -351,7 +350,7 @@ _UNUSED_ static long utstring_findR(
351350
UT_string *s,
352351
long P_StartPosition, /* Start from 0. -1 means last position. */
353352
const char *P_Needle,
354-
ssize_t P_NeedleLen)
353+
size_t P_NeedleLen)
355354
{
356355
long V_StartPosition;
357356
long V_HaystackLen;

0 commit comments

Comments
 (0)