Skip to content

Commit

Permalink
Fix more C++11 warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
sba1 committed Nov 1, 2018
1 parent 76ebece commit dcc2152
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion amiga-mui/messageviewclass.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ static int is_picture(void *data, int len)
/******************************************************************
Save the contents of a given mail to a given dest
*******************************************************************/
static void save_contents_to(struct MessageView_Data *data, struct mail_complete *mail, char *drawer, char *file)
static void save_contents_to(struct MessageView_Data *data, struct mail_complete *mail, const char *drawer, const char *file)
{
BPTR dlock;

Expand Down
2 changes: 1 addition & 1 deletion boyermoore.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ struct boyermoore_context *boyermoore_create_context(char *p, int plen)
context->plen = plen;

/* Prepare bad character skip table */
for (i = 0; i < (int)sizeof(context->skip_table)/sizeof(context->skip_table[0]); i++)
for (i = 0; i < (int)(sizeof(context->skip_table)/sizeof(context->skip_table[0])); i++)
context->skip_table[i] = plen;
for (i = 0; i < plen - 1; i++)
context->skip_table[(unsigned char)p[i]] = plen - i - 1;
Expand Down
4 changes: 2 additions & 2 deletions codecs.c
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,7 @@ char *encode_header_field_utf8(const char *field_name, const char *field_content

/*****************************************************************************/

char *encode_address_field(char *field_name, struct address_list *address_list)
char *encode_address_field(const char *field_name, struct address_list *address_list)
{
int field_len = strlen(field_name) + 2; /* including the ':' and the space */
int header_len;
Expand Down Expand Up @@ -842,7 +842,7 @@ char *encode_address_puny(utf8 *email)

/*****************************************************************************/

char *encode_address_field_utf8(char *field_name, struct address_list *address_list)
char *encode_address_field_utf8(const char *field_name, struct address_list *address_list)
{
struct address *address;

Expand Down
4 changes: 2 additions & 2 deletions codecs.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ char *encode_header_field_utf8(const char *field_name, const char *field_content
* @param address_list addresses to encoded
* @return the encoded string
*/
char *encode_address_field(char *field_name, struct address_list *address_list);
char *encode_address_field(const char *field_name, struct address_list *address_list);

/**
* Creates a structured address encoded header field (includes all rules of the
Expand All @@ -96,7 +96,7 @@ char *encode_address_field(char *field_name, struct address_list *address_list);
* @param address_list addresses to encoded
* @return the generated string. Must be freed with free().
*/
char *encode_address_field_utf8(char *field_name, struct address_list *address_list);
char *encode_address_field_utf8(const char *field_name, struct address_list *address_list);

/**
* Encode the given email address puny (RFC 3490)
Expand Down
8 changes: 4 additions & 4 deletions codesets.c
Original file line number Diff line number Diff line change
Expand Up @@ -1330,7 +1330,7 @@ utf8 *utf8create(void *from, const char *charset)

/*****************************************************************************/

int utf8fromstr(char *from, struct codeset *codeset, utf8 *dest, int dest_size)
int utf8fromstr(char *from, struct codeset *codeset, utf8 *dest, unsigned int dest_size)
{
char *src = from;
unsigned char c;
Expand Down Expand Up @@ -1418,7 +1418,7 @@ utf8 *utf8create_len(void *from, const char *charset, int from_len)

/*****************************************************************************/

int utf8tostr(const utf8 *str, char *dest, int dest_size, struct codeset *codeset)
int utf8tostr(const utf8 *str, char *dest, unsigned int dest_size, struct codeset *codeset)
{
int i;
struct single_convert *f;
Expand All @@ -1438,8 +1438,8 @@ int utf8tostr(const utf8 *str, char *dest, int dest_size, struct codeset *codese
{
if (c > 127)
{
int len_add = trailingBytesForUTF8[c];
int len_str = len_add + 1;
unsigned int len_add = trailingBytesForUTF8[c];
unsigned int len_str = len_add + 1;

BIN_SEARCH(codeset->table_sorted,0,255,mystrncmp((unsigned char*)str,codeset->table_sorted[m].utf8+1,len_str),f);

Expand Down
4 changes: 2 additions & 2 deletions codesets.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ utf8 *utf8create_len(void *from, const char *charset, int from_len);
* @param dest_size
* @return number of bytes within the destination buffer
*/
int utf8fromstr(char *str, struct codeset *codeset, utf8 *dest, int dest_size);
int utf8fromstr(char *str, struct codeset *codeset, utf8 *dest, unsigned int dest_size);

/**
* Converts a utf8 string to a given charset. Return the number of bytes
Expand All @@ -206,7 +206,7 @@ int utf8fromstr(char *str, struct codeset *codeset, utf8 *dest, int dest_size);
* @param codeset
* @return
*/
int utf8tostr(const utf8 *str, char *dest, int dest_size, struct codeset *codeset);
int utf8tostr(const utf8 *str, char *dest, unsigned int dest_size, struct codeset *codeset);

/**
* Converts a UTF8 string to a representation as given by the charset.
Expand Down

0 comments on commit dcc2152

Please sign in to comment.