mirror of
https://github.com/gryf/wmaker.git
synced 2026-01-06 13:54:12 +01:00
WUtil: Added 'const' attribute on non-modified arguments to functions
A number of functions do not actually modify the strings given as parameter, but only read or duplicate it. In this case it is a good practice to mark that parameter as pointer-to-const to let the compiler known about it, to be able to perform appropriate optimisations.
This commit is contained in:
committed by
Carlos R. Mafra
parent
ac89706859
commit
bbf84eb0e8
@@ -203,7 +203,7 @@ char *wstrndup(const char *str, size_t len)
|
||||
return copy;
|
||||
}
|
||||
|
||||
char *wstrconcat(char *str1, char *str2)
|
||||
char *wstrconcat(const char *str1, const char *str2)
|
||||
{
|
||||
char *str;
|
||||
size_t slen;
|
||||
@@ -226,7 +226,7 @@ char *wstrconcat(char *str1, char *str2)
|
||||
return str;
|
||||
}
|
||||
|
||||
char *wstrappend(char *dst, char *src)
|
||||
char *wstrappend(char *dst, const char *src)
|
||||
{
|
||||
size_t slen;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user