summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2015-05-26 22:54:36 -0400
committermidipix <writeonce@midipix.org>2015-09-26 10:17:06 -0400
commit239ee42e5853e09d8e5bb4b9c704f05ce9181c91 (patch)
tree87af9f3995fd04872d625baf24d7a845e2cc7caa /src
parentfeffc7263bb2fd33ae467de2dd51f1ddbbb1b895 (diff)
downloadpemagine-239ee42e5853e09d8e5bb4b9c704f05ce9181c91.tar.bz2
pemagine-239ee42e5853e09d8e5bb4b9c704f05ce9181c91.tar.xz
internal string functions: change the return type from size_t to uint32_t.
Diffstat (limited to 'src')
-rw-r--r--src/internal/pe_impl.c8
-rw-r--r--src/internal/pe_impl.h4
2 files changed, 6 insertions, 6 deletions
diff --git a/src/internal/pe_impl.c b/src/internal/pe_impl.c
index 46069e8..2611f6b 100644
--- a/src/internal/pe_impl.c
+++ b/src/internal/pe_impl.c
@@ -8,7 +8,7 @@
#include <pemagine/pemagine.h>
#include "pe_impl.h"
-size_t pe_impl_strlen_ansi(const char * str)
+uint32_t pe_impl_strlen_ansi(const char * str)
{
char * ch;
char * upper_bound;
@@ -19,13 +19,13 @@ size_t pe_impl_strlen_ansi(const char * str)
for (ch = (char *)str; (ch < upper_bound) && (*ch); ch++);
if (ch < upper_bound)
- return (size_t)((intptr_t)ch - (intptr_t)str);
+ return (uint32_t)(ch - str);
else
return -1;
}
-size_t pe_impl_strlen_utf16(const wchar16_t * str)
+uint32_t pe_impl_strlen_utf16(const wchar16_t * str)
{
wchar16_t * wch;
wchar16_t * upper_bound;
@@ -36,7 +36,7 @@ size_t pe_impl_strlen_utf16(const wchar16_t * str)
for (wch = (wchar16_t *)str; (wch < upper_bound) && (*wch); wch++);
if (wch < upper_bound)
- return (size_t)((intptr_t)wch - (intptr_t)str);
+ return (uint32_t)(wch - str);
else
return -1;
}
diff --git a/src/internal/pe_impl.h b/src/internal/pe_impl.h
index 09e81c9..392f6b2 100644
--- a/src/internal/pe_impl.h
+++ b/src/internal/pe_impl.h
@@ -12,6 +12,6 @@ struct pe_block {
uint32_t size;
};
-size_t pe_impl_strlen_ansi(const char * str);
-size_t pe_impl_strlen_utf16(const wchar16_t * str);
+uint32_t pe_impl_strlen_ansi(const char * str);
+uint32_t pe_impl_strlen_utf16(const wchar16_t * str);
wchar16_t pe_impl_utf16_char_to_lower(const wchar16_t c);