GUAC-608: Make guac_iconv input const.

This commit is contained in:
Michael Jumper 2014-04-08 16:31:25 -07:00
parent 6743795a68
commit c95e2fd056
4 changed files with 11 additions and 11 deletions

View File

@ -64,13 +64,13 @@ const static int __GUAC_RDP_CP1252_CODEPOINT[32] = {
0x0178, /* 0x9F */ 0x0178, /* 0x9F */
}; };
int guac_iconv(guac_iconv_read* reader, char** input, int in_remaining, int guac_iconv(guac_iconv_read* reader, const char** input, int in_remaining,
guac_iconv_write* writer, char** output, int out_remaining) { guac_iconv_write* writer, char** output, int out_remaining) {
while (in_remaining > 0 && out_remaining > 0) { while (in_remaining > 0 && out_remaining > 0) {
int value; int value;
char* read_start; const char* read_start;
char* write_start; char* write_start;
/* Read character */ /* Read character */
@ -94,7 +94,7 @@ int guac_iconv(guac_iconv_read* reader, char** input, int in_remaining,
} }
int GUAC_READ_UTF8(char** input, int remaining) { int GUAC_READ_UTF8(const char** input, int remaining) {
int value; int value;
@ -103,7 +103,7 @@ int GUAC_READ_UTF8(char** input, int remaining) {
} }
int GUAC_READ_UTF16(char** input, int remaining) { int GUAC_READ_UTF16(const char** input, int remaining) {
int value; int value;
@ -119,7 +119,7 @@ int GUAC_READ_UTF16(char** input, int remaining) {
} }
int GUAC_READ_CP1252(char** input, int remaining) { int GUAC_READ_CP1252(const char** input, int remaining) {
int value = *((unsigned char*) *input); int value = *((unsigned char*) *input);
@ -132,7 +132,7 @@ int GUAC_READ_CP1252(char** input, int remaining) {
} }
int GUAC_READ_ISO8859_1(char** input, int remaining) { int GUAC_READ_ISO8859_1(const char** input, int remaining) {
int value = *((unsigned char*) *input); int value = *((unsigned char*) *input);

View File

@ -30,7 +30,7 @@
* the Unicode codepoint read, updating the string pointer to point to the * the Unicode codepoint read, updating the string pointer to point to the
* byte immediately after the character read. * byte immediately after the character read.
*/ */
typedef int guac_iconv_read(char** input, int remaining); typedef int guac_iconv_read(const char** input, int remaining);
/** /**
* Function writes the character having the given Unicode codepoint value to * Function writes the character having the given Unicode codepoint value to
@ -56,7 +56,7 @@ typedef void guac_iconv_write(char** output, int remaining, int value);
* @return Non-zero if the NULL terminator of the input string was read and * @return Non-zero if the NULL terminator of the input string was read and
* copied into the destination string, zero otherwise. * copied into the destination string, zero otherwise.
*/ */
int guac_iconv(guac_iconv_read* reader, char** input, int in_remaining, int guac_iconv(guac_iconv_read* reader, const char** input, int in_remaining,
guac_iconv_write* writer, char** output, int out_remaining); guac_iconv_write* writer, char** output, int out_remaining);
/** /**

View File

@ -175,7 +175,7 @@ void guac_rdp_process_cb_data_request(guac_client* client,
rdpChannels* channels = client_data->rdp_inst->context->channels; rdpChannels* channels = client_data->rdp_inst->context->channels;
guac_iconv_write* writer; guac_iconv_write* writer;
char* input = client_data->clipboard->buffer; const char* input = client_data->clipboard->buffer;
char* output = malloc(GUAC_RDP_CLIPBOARD_MAX_LENGTH); char* output = malloc(GUAC_RDP_CLIPBOARD_MAX_LENGTH);
RDP_CB_DATA_RESPONSE_EVENT* data_response; RDP_CB_DATA_RESPONSE_EVENT* data_response;
@ -222,7 +222,7 @@ void guac_rdp_process_cb_data_response(guac_client* client,
char received_data[GUAC_RDP_CLIPBOARD_MAX_LENGTH]; char received_data[GUAC_RDP_CLIPBOARD_MAX_LENGTH];
guac_iconv_read* reader; guac_iconv_read* reader;
char* input = (char*) event->data; const char* input = (char*) event->data;
char* output = received_data; char* output = received_data;
/* Find correct source encoding */ /* Find correct source encoding */

View File

@ -35,7 +35,7 @@ static void test_conversion(
char output[4096]; char output[4096];
char input[4096]; char input[4096];
char* current_input = input; const char* current_input = input;
char* current_output = output; char* current_output = output;
memcpy(input, in_string, in_length); memcpy(input, in_string, in_length);