Changeset: 3ac2fa5dd73e for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/3ac2fa5dd73e
Modified Files:
clients/Tests/exports.stable.out
monetdb5/modules/atoms/str.c
monetdb5/modules/atoms/str.h
monetdb5/modules/kernel/batstr.c
Branch: default
Log Message:
No need for restrict on parameters if they are the only pointer around.
diffs (92 lines):
diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out
--- a/clients/Tests/exports.stable.out
+++ b/clients/Tests/exports.stable.out
@@ -802,8 +802,8 @@ void TABLETdestroy_format(Tablet *as);
int TABLEToutput_file(Tablet *as, BAT *order, stream *s, bstream *in);
int TRACEtable(Client cntxt, BAT **r);
int TYPE_xml;
-int UTF8_strlen(const char *restrict s);
-int UTF8_strwidth(const char *restrict s);
+int UTF8_strlen(const char *s);
+int UTF8_strwidth(const char *s);
void addMalException(MalBlkPtr mb, str msg);
str addOptimizerPipe(Client cntxt, MalBlkPtr mb, const char *name);
str addPipeDefinition(Client cntxt, const char *name, const char *pipe);
@@ -1253,7 +1253,7 @@ const char *stoptraceRef;
void strAfterCall(ValPtr v, ValPtr bak);
void strBeforeCall(ValPtr v, ValPtr bak);
const char *strRef;
-int str_strlen(const char *restrict s);
+int str_strlen(const char *s);
const char *streamsRef;
const char *strimpsRef;
const char *subavgRef;
diff --git a/monetdb5/modules/atoms/str.c b/monetdb5/modules/atoms/str.c
--- a/monetdb5/modules/atoms/str.c
+++ b/monetdb5/modules/atoms/str.c
@@ -3025,8 +3025,8 @@ STRepilogue(void *ret)
}
#ifndef NDEBUG
-static void
-UTF8_assert(const char *restrict s)
+static inline void
+UTF8_assert(const char *s)
{
int c;
@@ -3143,7 +3143,7 @@ UTF8_offset(char *restrict s, int n)
}
int
-UTF8_strlen(const char *restrict s)
+UTF8_strlen(const char *s)
{ /* This
function assumes, s is never nil */
size_t pos = 0;
@@ -3160,7 +3160,7 @@ UTF8_strlen(const char *restrict s)
}
int
-str_strlen(const char *restrict s)
+str_strlen(const char *s)
{ /* This
function assumes, s is never nil */
size_t pos = strlen(s);
assert(pos < INT_MAX);
@@ -3169,7 +3169,7 @@ str_strlen(const char *restrict s)
/* return the display width of s */
int
-UTF8_strwidth(const char *restrict s)
+UTF8_strwidth(const char *s)
{
int len = 0;
int c;
diff --git a/monetdb5/modules/atoms/str.h b/monetdb5/modules/atoms/str.h
--- a/monetdb5/modules/atoms/str.h
+++ b/monetdb5/modules/atoms/str.h
@@ -141,9 +141,9 @@
} while (0)
mal_export bool batstr_func_has_candidates(const char *func);
-mal_export int UTF8_strwidth(const char *restrict s);
-mal_export int UTF8_strlen(const char *restrict s);
-mal_export int str_strlen(const char *restrict s);
+mal_export int UTF8_strwidth(const char *s);
+mal_export int UTF8_strlen(const char *s);
+mal_export int str_strlen(const char *s);
/* For str returning functions, the result is passed as the input parameter
buf. The returned str indicates
if the function succeeded (ie malloc failure or invalid unicode character).
str_wchr_at function also
diff --git a/monetdb5/modules/kernel/batstr.c b/monetdb5/modules/kernel/batstr.c
--- a/monetdb5/modules/kernel/batstr.c
+++ b/monetdb5/modules/kernel/batstr.c
@@ -76,7 +76,7 @@ str_prefix(str *buf, size_t *buflen, con
static str
do_batstr_int(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci,
- const char *name, int (*func)(const char *restrict))
+ const char *name, int (*func)(const char *))
{
BATiter bi;
BAT *bn = NULL, *b = NULL, *bs = NULL;
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]