diff options
| author | Pavel Roskin <plroskin@gmail.com> | 2016-06-21 16:30:17 -0700 |
|---|---|---|
| committer | Pavel Roskin <plroskin@gmail.com> | 2016-07-08 04:29:42 +0000 |
| commit | aeeb3d2c2e26677758a64db496c86020f99d2f1a (patch) | |
| tree | 3337017e28744427743d447d4735c00537783321 /common | |
| parent | a680d46edf747ec17456b6b8e69c95bc4e4407cb (diff) | |
| download | xrdp-proprietary-aeeb3d2c2e26677758a64db496c86020f99d2f1a.tar.gz xrdp-proprietary-aeeb3d2c2e26677758a64db496c86020f99d2f1a.zip | |
Fix warnings detected by -Wwrite-strings
Diffstat (limited to 'common')
| -rw-r--r-- | common/os_calls.c | 10 | ||||
| -rw-r--r-- | common/os_calls.h | 6 | ||||
| -rw-r--r-- | common/ssl_calls.c | 4 | ||||
| -rw-r--r-- | common/ssl_calls.h | 2 |
4 files changed, 11 insertions, 11 deletions
diff --git a/common/os_calls.c b/common/os_calls.c index 9a409591..7d932a10 100644 --- a/common/os_calls.c +++ b/common/os_calls.c @@ -1810,7 +1810,7 @@ g_file_read(int fd, char *ptr, int len) /*****************************************************************************/ /* write to file, returns the number of bytes written or -1 on error */ int APP_CC -g_file_write(int fd, char *ptr, int len) +g_file_write(int fd, const char *ptr, int len) { #if defined(_WIN32) @@ -1947,7 +1947,7 @@ g_get_current_dir(char *dirname, int maxlen) /*****************************************************************************/ /* returns error, zero on success and -1 on failure */ int APP_CC -g_set_current_dir(char *dirname) +g_set_current_dir(const char *dirname) { #if defined(_WIN32) @@ -2116,7 +2116,7 @@ g_strlen(const char *text) /*****************************************************************************/ /* locates char in text */ -char* APP_CC +const char *APP_CC g_strchr(const char* text, int c) { if (text == NULL) @@ -2395,7 +2395,7 @@ g_htoi(char *str) int APP_CC g_pos(const char *str, const char *to_find) { - char *pp; + const char *pp; pp = strstr(str, to_find); @@ -3263,7 +3263,7 @@ g_save_to_bmp(const char* filename, char* data, int stride_bytes, data -= stride_bytes; if ((depth == 24) && (bits_per_pixel == 32)) { - line = malloc(file_stride_bytes); + line = (char *) malloc(file_stride_bytes); memset(line, 0, file_stride_bytes); for (index = 0; index < height; index++) { diff --git a/common/os_calls.h b/common/os_calls.h index 0a58d4a8..6a7cd093 100644 --- a/common/os_calls.h +++ b/common/os_calls.h @@ -104,14 +104,14 @@ int APP_CC g_file_open_ex(const char *file_name, int aread, int awrite, int acreate, int atrunc); int APP_CC g_file_close(int fd); int APP_CC g_file_read(int fd, char* ptr, int len); -int APP_CC g_file_write(int fd, char* ptr, int len); +int APP_CC g_file_write(int fd, const char *ptr, int len); int APP_CC g_file_seek(int fd, int offset); int APP_CC g_file_lock(int fd, int start, int len); int APP_CC g_chmod_hex(const char* filename, int flags); int APP_CC g_chown(const char* name, int uid, int gid); int APP_CC g_mkdir(const char* dirname); char* APP_CC g_get_current_dir(char* dirname, int maxlen); -int APP_CC g_set_current_dir(char* dirname); +int APP_CC g_set_current_dir(const char *dirname); int APP_CC g_file_exist(const char* filename); int APP_CC g_directory_exist(const char* dirname); int APP_CC g_create_dir(const char* dirname); @@ -120,7 +120,7 @@ int APP_CC g_remove_dir(const char* dirname); int APP_CC g_file_delete(const char* filename); int APP_CC g_file_get_size(const char* filename); int APP_CC g_strlen(const char* text); -char* APP_CC g_strchr(const char* text, int c); +const char *APP_CC g_strchr(const char *text, int c); char* APP_CC g_strcpy(char* dest, const char* src); char* APP_CC g_strncpy(char* dest, const char* src, int len); char* APP_CC g_strcat(char* dest, const char* src); diff --git a/common/ssl_calls.c b/common/ssl_calls.c index b7eb6131..3d9e1c2e 100644 --- a/common/ssl_calls.c +++ b/common/ssl_calls.c @@ -111,7 +111,7 @@ ssl_sha1_clear(void *sha1_info) /*****************************************************************************/ void APP_CC -ssl_sha1_transform(void *sha1_info, char *data, int len) +ssl_sha1_transform(void *sha1_info, const char *data, int len) { SHA1_Update((SHA_CTX *)sha1_info, data, len); } @@ -560,7 +560,7 @@ ssl_tls_create(struct trans *trans, const char *key, const char *cert) /*****************************************************************************/ int APP_CC -ssl_tls_print_error(char *func, SSL *connection, int value) +ssl_tls_print_error(const char *func, SSL *connection, int value) { switch (SSL_get_error(connection, value)) { diff --git a/common/ssl_calls.h b/common/ssl_calls.h index 6cfe73a3..c470e63a 100644 --- a/common/ssl_calls.h +++ b/common/ssl_calls.h @@ -41,7 +41,7 @@ ssl_sha1_info_delete(void* sha1_info); void APP_CC ssl_sha1_clear(void* sha1_info); void APP_CC -ssl_sha1_transform(void* sha1_info, char* data, int len); +ssl_sha1_transform(void* sha1_info, const char *data, int len); void APP_CC ssl_sha1_complete(void* sha1_info, char* data); void* APP_CC |
