summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorPavel Roskin <plroskin@gmail.com>2016-10-16 23:14:06 -0700
committerPavel Roskin <plroskin@gmail.com>2016-10-17 08:54:07 -0700
commit6fef1e4eb53877d41f52f2b4d93ea11eb680b6b3 (patch)
tree6d1c34a0f0b598b802af3fdcf31c40d0ad1b64c4 /common
parentbc868b96b1a88085cf141428ef8c72f5cd496c2e (diff)
downloadxrdp-proprietary-6fef1e4eb53877d41f52f2b4d93ea11eb680b6b3.tar.gz
xrdp-proprietary-6fef1e4eb53877d41f52f2b4d93ea11eb680b6b3.zip
Use const pointers in function arguments when possible
Diffstat (limited to 'common')
-rw-r--r--common/list.c2
-rw-r--r--common/list.h2
-rw-r--r--common/log.c2
-rw-r--r--common/log.h2
-rw-r--r--common/os_calls.c4
-rw-r--r--common/os_calls.h4
6 files changed, 8 insertions, 8 deletions
diff --git a/common/list.c b/common/list.c
index 5873d41d..47b15737 100644
--- a/common/list.c
+++ b/common/list.c
@@ -82,7 +82,7 @@ list_add_item(struct list *self, tbus item)
/*****************************************************************************/
tbus APP_CC
-list_get_item(struct list *self, int index)
+list_get_item(const struct list *self, int index)
{
if (index < 0 || index >= self->count)
{
diff --git a/common/list.h b/common/list.h
index cdc545a0..146aab11 100644
--- a/common/list.h
+++ b/common/list.h
@@ -40,7 +40,7 @@ list_delete(struct list* self);
void APP_CC
list_add_item(struct list* self, tintptr item);
tintptr APP_CC
-list_get_item(struct list* self, int index);
+list_get_item(const struct list *self, int index);
void APP_CC
list_clear(struct list* self);
int APP_CC
diff --git a/common/log.c b/common/log.c
index 77bcc6d6..86935acd 100644
--- a/common/log.c
+++ b/common/log.c
@@ -222,7 +222,7 @@ internal_log_end(struct log_config *l_cfg)
* @return
*/
enum logLevels DEFAULT_CC
-internal_log_text2level(char *buf)
+internal_log_text2level(const char *buf)
{
if (0 == g_strcasecmp(buf, "0") ||
0 == g_strcasecmp(buf, "core"))
diff --git a/common/log.h b/common/log.h
index 7706fa4c..33bb41fd 100644
--- a/common/log.h
+++ b/common/log.h
@@ -113,7 +113,7 @@ internal_log_lvl2str(const enum logLevels lvl, char *str);
*
*/
enum logLevels DEFAULT_CC
-internal_log_text2level(char *s);
+internal_log_text2level(const char *s);
/**
* A function that init our struct that holds all state and
diff --git a/common/os_calls.c b/common/os_calls.c
index c101ad74..0ba4fd98 100644
--- a/common/os_calls.c
+++ b/common/os_calls.c
@@ -264,7 +264,7 @@ g_write(const char *format, ...)
/*****************************************************************************/
/* produce a hex dump */
void APP_CC
-g_hexdump(char *p, int len)
+g_hexdump(const char *p, int len)
{
unsigned char *line;
int i;
@@ -1342,7 +1342,7 @@ g_set_nonblock(int fd)
/*****************************************************************************/
/* returns 0 on error */
tintptr APP_CC
-g_create_wait_obj(char *name)
+g_create_wait_obj(const char *name)
{
#ifdef _WIN32
tintptr obj;
diff --git a/common/os_calls.h b/common/os_calls.h
index c103e144..00e91a1d 100644
--- a/common/os_calls.h
+++ b/common/os_calls.h
@@ -55,7 +55,7 @@ int DEFAULT_CC g_snprintf(char* dest, int len, const char* format, ...) \
printflike(3, 4);
void DEFAULT_CC g_writeln(const char* format, ...) printflike(1, 2);
void DEFAULT_CC g_write(const char* format, ...) printflike(1, 2);
-void APP_CC g_hexdump(char* p, int len);
+void APP_CC g_hexdump(const char *p, int len);
void APP_CC g_memset(void* ptr, int val, int size);
void APP_CC g_memcpy(void* d_ptr, const void* s_ptr, int size);
int APP_CC g_getchar(void);
@@ -88,7 +88,7 @@ int APP_CC g_sck_can_recv(int sck, int millis);
int APP_CC g_sck_select(int sck1, int sck2);
void APP_CC g_write_ip_address(int rcv_sck, char* ip_address, int bytes);
void APP_CC g_sleep(int msecs);
-tintptr APP_CC g_create_wait_obj(char* name);
+tintptr APP_CC g_create_wait_obj(const char *name);
tintptr APP_CC g_create_wait_obj_from_socket(tintptr socket, int write);
void APP_CC g_delete_wait_obj_from_socket(tintptr wait_obj);
int APP_CC g_set_wait_obj(tintptr obj);