64-bit warning fixes

master
Yevgen Muntyan 2017-05-16 20:45:46 -07:00
parent c13468f8ed
commit cabd3e990e
14 changed files with 20 additions and 20 deletions

View File

@ -4643,7 +4643,7 @@ get_line_info (GtkTextBuffer *buffer,
{
line->eol_length = 0;
line->char_length = g_utf8_strlen (line->text, -1);
line->byte_length = strlen (line->text);
line->byte_length = (int) strlen (line->text);
}
else
{

View File

@ -199,8 +199,8 @@ utf8_caselessnmatch (const char *s1, const char *s2,
gchar *casefold;
gchar *normalized_s1;
gchar *normalized_s2;
gint len_s1;
gint len_s2;
gssize len_s1;
gssize len_s2;
gboolean ret = FALSE;
g_return_val_if_fail (s1 != NULL, FALSE);

View File

@ -206,7 +206,7 @@ parse_files (void)
char *current_dir = NULL;
MooOpenInfoArray *files;
if (medit_opts.files.empty() || !(n_files = medit_opts.files.size()))
if (medit_opts.files.empty() || !(n_files = (int) medit_opts.files.size()))
return NULL;
files = moo_open_info_array_new ();

View File

@ -655,7 +655,7 @@ _moo_html_load_memory (GtkTextView *view,
data = moo_html_get_data (view);
if (size < 0)
size = strlen (buffer);
size = (int) strlen (buffer);
doc = htmlReadMemory (buffer, size, url, encoding,
HTML_PARSE_NONET);
@ -1600,7 +1600,7 @@ moo_html_insert_verbatim (GtkTextView *view,
if (text[0] == '\n' && data->new_line)
text++;
len = strlen (text);
len = (guint) strlen (text);
if (!len)
return;

View File

@ -24,7 +24,7 @@ gstr g::build_filename_impl(const char* comp1, const char* comp2, const char* co
gstr g::build_filenamev(const std::vector<gstr>& components)
{
GPtrArray* strv = g_ptr_array_new_full(components.size() + 1, nullptr);
GPtrArray* strv = g_ptr_array_new_full((guint)components.size() + 1, nullptr);
for (const auto& comp: components)
g_ptr_array_add(strv, const_cast<char*>(comp.get()));
g_ptr_array_add(strv, nullptr);

View File

@ -1722,7 +1722,7 @@ insert_action_new (GtkTextBuffer *buffer,
EditAction *edit_action;
if (length < 0)
length = strlen (text);
length = (int) strlen (text);
g_return_val_if_fail (length > 0, NULL);

View File

@ -356,7 +356,7 @@ typedef struct Table {
(check_exp((size&(size-1))==0, (cast(int, (s) & ((size)-1)))))
#define twoto(x) (1<<(x))
#define twoto(x) (((size_t)1)<<(x))
#define sizenode(t) (twoto((t)->lsizenode))

View File

@ -37,7 +37,7 @@ lua_push_utf8string (lua_State *L,
luaL_error (L, "string is not valid UTF-8");
if (len < 0)
len = strlen (s);
len = (int) strlen (s);
lua_pushlstring (L, s, len);
}

View File

@ -234,7 +234,7 @@ static int unic_len (lua_State *L) {
size_t l;
const char *s = luaL_checklstring(L, 1, &l);
int mode = lua_tointeger(L, lua_upvalueindex(1));
if (MODE_MBYTE(mode)) l = (size_t)utf8_count(&s, l, mode-2, -1);
if (MODE_MBYTE(mode)) l = (size_t)utf8_count(&s, (int)l, mode-2, -1);
lua_pushinteger(L, l);
return 1;
}
@ -253,7 +253,7 @@ static int unic_sub (lua_State *L) {
ptrdiff_t end = luaL_optinteger(L, 3, -1);
int mode = lua_tointeger(L, lua_upvalueindex(1));
if (MODE_MBYTE(mode)) { p=s; l = (size_t)utf8_count(&p, l, mode-2, -1); }
if (MODE_MBYTE(mode)) { p = s; l = (size_t)utf8_count(&p, (int)l, mode - 2, -1); }
start = posrelat(start, l);
end = posrelat(end, l);
if (start < 1) start = 1;
@ -267,7 +267,7 @@ static int unic_sub (lua_State *L) {
else {
if (start) utf8_count(&s, e-s, mode-2, start); /* skip */
p = s;
utf8_count(&p, e-p, mode-2, l);
utf8_count(&p, (int)(e - p), mode - 2, (int)l);
l = p-s;
}
lua_pushlstring(L, s, l);
@ -354,7 +354,7 @@ static int unic_byte (lua_State *L) {
const char *s = luaL_checklstring(L, 1, &l), *p, *e=s+l;
int n, mode = lua_tointeger(L, lua_upvalueindex(1)), mb = MODE_MBYTE(mode);
if (mb) { p=s; l = (size_t)utf8_count(&p, l, mode-2, -1); }
if (mb) { p=s; l = (size_t)utf8_count(&p, (int)l, mode-2, -1); }
posi = posrelat(luaL_optinteger(L, 2, 1), l);
pose = posrelat(luaL_optinteger(L, 3, posi), l);
if (posi <= 0) posi = 1;

View File

@ -1352,7 +1352,7 @@ moo_lua_get_arg_object_array (lua_State *L,
}
MooObjectArray *array = moo_object_array_new ();
for (int i = 0, c = vec.size(); i < c; ++i)
for (int i = 0, c = (int) vec.size(); i < c; ++i)
moo_object_array_append (array, G_OBJECT (vec[i]));
return array;
@ -1414,7 +1414,7 @@ moo_lua_get_arg_strv (lua_State *L,
}
char **strv = g_new (char*, vec.size() + 1);
for (int i = 0, c = vec.size(); i < c; ++i)
for (int i = 0, c = (int) vec.size(); i < c; ++i)
strv[i] = g_strdup (vec[i].c_str());
strv[vec.size()] = NULL;

View File

@ -227,7 +227,7 @@ moo_ipc_send (GObject *sender,
gssize len)
{
GString *header;
guint id_len;
gsize id_len;
g_return_if_fail (!sender || G_IS_OBJECT (sender));
g_return_if_fail (id != NULL);

View File

@ -705,7 +705,7 @@ xdg_mime_media_type_equal (const char *mime_a,
static int
xdg_mime_is_super_type (const char *mime)
{
int length;
gssize length;
const char *type;
length = strlen (mime);

View File

@ -759,7 +759,7 @@ _xdg_mime_cache_get_mime_types_from_file_name (const char *file_name,
static int
is_super_type (const char *mime)
{
int length;
gssize length;
const char *type;
length = strlen (mime);

View File

@ -323,7 +323,7 @@ _xdg_mime_magic_parse_magic_line (FILE *magic_file,
int c;
int end_of_file;
int indent = 0;
int bytes_read;
gssize bytes_read;
assert (magic_file != NULL);