Skip to content

Commit

Permalink
Moving to 64-bit integers for all
Browse files Browse the repository at this point in the history
  • Loading branch information
benedictpaten committed Apr 17, 2013
1 parent a47b474 commit a0668d4
Show file tree
Hide file tree
Showing 33 changed files with 669 additions and 668 deletions.
5 changes: 3 additions & 2 deletions external/CuTest.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <math.h>

#include "CuTest.h"
#include <inttypes.h>

/*-------------------------------------------------------------------------*
* CuStr
Expand Down Expand Up @@ -234,11 +235,11 @@ void CuAssertPtrEquals_LineMsg(CuTest* tc, const char* file, int line, const cha
//////////////////////////////////////////////////
// added by dent earl, dent.earl (a) gmail com
void CuAssertUInt32Equals_LineMsg(CuTest* tc, const char* file, int line, const char* message,
uint32_t expected, uint32_t actual)
uint64_t expected, uint64_t actual)
{
char buf[STRING_MAX];
if (expected == actual) return;
sprintf(buf, "expected <%u> but was <%u>", expected, actual);
sprintf(buf, "expected <%" PRIu64 "> but was <%" PRIu64 ">", expected, actual);
CuFail_Line(tc, file, line, message, buf);
}
//////////////////////////////////////////////////
Expand Down
2 changes: 1 addition & 1 deletion external/CuTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ void CuAssertPtrEquals_LineMsg(CuTest* tc,
// added by dent earl, dent.earl (a) gmail com
void CuAssertUInt32Equals_LineMsg(CuTest* tc,
const char* file, int line, const char* message,
uint32_t expected, uint32_t actual);
uint64_t expected, uint64_t actual);
//////////////////////////////////////////////////

/* public assert functions */
Expand Down
6 changes: 3 additions & 3 deletions include/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ void* de_malloc(size_t n) {
}
return i;
}
int32_t de_getline(char **s, int32_t *n, FILE *f) {
register int32_t nMinus1 = ((*n) - 1), i = 0;
int64_t de_getline(char **s, int64_t *n, FILE *f) {
register int64_t nMinus1 = ((*n) - 1), i = 0;
char *s2 = *s;
while (1) {
register int32_t ch = (char) getc(f);
register int64_t ch = (char) getc(f);
if (ch == '\r') {
ch = getc(f);
}
Expand Down
2 changes: 1 addition & 1 deletion include/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const int kMaxSeqName;
void de_verbose(char const *fmt, ...);
void de_debug(char const *fmt, ...);
void* de_malloc(size_t n);
int32_t de_getline(char **s, int32_t *n, FILE *f);
int64_t de_getline(char **s, int64_t *n, FILE *f);
FILE* de_fopen(const char *s, char const *mode);
char* de_strdup(const char *s);
char* de_strndup(const char *s, size_t n);
Expand Down
Loading

0 comments on commit a0668d4

Please sign in to comment.