mirror of https://github.com/MidnightCommander/mc
x86_64: Cleanup of code for master
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
This commit is contained in:
parent
bff2f7303b
commit
054c5d6f44
|
@ -1455,8 +1455,8 @@ editcmd_find (WEdit *edit, gsize *len)
|
|||
if (edit_search_options.backwards) {
|
||||
search_end = end_mark;
|
||||
while ((int) search_start >= start_mark) {
|
||||
if (search_end > search_start + edit->search->original_len
|
||||
&& mc_search_is_fixed_search_str(edit->search)) {
|
||||
if (search_end > (off_t) (search_start + edit->search->original_len) &&
|
||||
mc_search_is_fixed_search_str(edit->search)) {
|
||||
search_end = search_start + edit->search->original_len;
|
||||
}
|
||||
if (mc_search_run(edit->search, (void *) edit, search_start, search_end, len)
|
||||
|
|
|
@ -486,7 +486,9 @@ file_progress_show_count (FileOpContext *ctx, off_t done, off_t total)
|
|||
if (!verbose)
|
||||
return;
|
||||
|
||||
g_snprintf (buffer, BUF_TINY, _("Files processed: %llu of %llu"), done, total);
|
||||
g_snprintf (buffer, BUF_TINY, _("Files processed: %llu of %llu"),
|
||||
(unsigned long long) done,
|
||||
(unsigned long long) total);
|
||||
|
||||
label_set_text (ui->total_files_processed_label, buffer);
|
||||
}
|
||||
|
|
|
@ -278,7 +278,7 @@ panel_save_setup (struct WPanel *panel, const char *section)
|
|||
mc_config_set_string(mc_panels_config, section, "user_format", panel->user_format);
|
||||
|
||||
for (i = 0; i < LIST_TYPES; i++){
|
||||
buffer = g_strdup_printf("user_status%d", i);
|
||||
buffer = g_strdup_printf("user_status%d", (int) i);
|
||||
mc_config_set_string(mc_panels_config, section, buffer, panel->user_status_format [i]);
|
||||
g_free(buffer);
|
||||
}
|
||||
|
@ -452,7 +452,7 @@ panel_load_setup (WPanel *panel, const char *section)
|
|||
|
||||
for (i = 0; i < LIST_TYPES; i++){
|
||||
g_free (panel->user_status_format [i]);
|
||||
buffer = g_strdup_printf("user_status%d",i);
|
||||
buffer = g_strdup_printf("user_status%d", (int)i);
|
||||
panel->user_status_format [i] =
|
||||
mc_config_get_string(mc_panels_config, section, buffer, DEFAULT_USER_FORMAT);
|
||||
g_free(buffer);
|
||||
|
|
|
@ -146,7 +146,7 @@ char *
|
|||
mcview_get_ptr_string (mcview_t * view, off_t byte_index)
|
||||
{
|
||||
assert (view->datasource == DS_STRING);
|
||||
if (byte_index < view->ds_string_len)
|
||||
if (byte_index < (off_t) view->ds_string_len)
|
||||
return (char *) (view->ds_string_data + byte_index);
|
||||
return NULL;
|
||||
}
|
||||
|
@ -211,7 +211,7 @@ gboolean
|
|||
mcview_get_byte_string (mcview_t * view, off_t byte_index, int *retval)
|
||||
{
|
||||
assert (view->datasource == DS_STRING);
|
||||
if (byte_index < view->ds_string_len) {
|
||||
if (byte_index < (off_t) view->ds_string_len) {
|
||||
if (retval)
|
||||
*retval = view->ds_string_data[byte_index];
|
||||
return TRUE;
|
||||
|
@ -279,7 +279,7 @@ mcview_file_load_data (mcview_t * view, off_t byte_index)
|
|||
bytes_read += (size_t) res;
|
||||
}
|
||||
view->ds_file_offset = blockoffset;
|
||||
if (bytes_read > view->ds_file_filesize - view->ds_file_offset) {
|
||||
if ((off_t) bytes_read > view->ds_file_filesize - view->ds_file_offset) {
|
||||
/* the file has grown in the meantime -- stick to the old size */
|
||||
view->ds_file_datalen = view->ds_file_filesize - view->ds_file_offset;
|
||||
} else {
|
||||
|
|
|
@ -178,7 +178,7 @@ mcview_get_byte_growing_buffer (mcview_t * view, off_t byte_index, int *retval)
|
|||
|
||||
assert (view->growbuf_in_use);
|
||||
|
||||
if ((size_t) pageno != pageno)
|
||||
if (pageno < 0)
|
||||
return FALSE;
|
||||
|
||||
mcview_growbuf_read_until (view, byte_index + 1);
|
||||
|
@ -189,7 +189,7 @@ mcview_get_byte_growing_buffer (mcview_t * view, off_t byte_index, int *retval)
|
|||
*retval = *((byte *) (g_ptr_array_index(view->growbuf_blockptr, pageno) + pageindex));
|
||||
return TRUE;
|
||||
}
|
||||
if (pageno == view->growbuf_blockptr->len - 1 && pageindex < view->growbuf_lastindex) {
|
||||
if (pageno == view->growbuf_blockptr->len - 1 && pageindex < (off_t) view->growbuf_lastindex) {
|
||||
if (retval)
|
||||
*retval = *((byte *) (g_ptr_array_index(view->growbuf_blockptr, pageno) + pageindex));
|
||||
return TRUE;
|
||||
|
@ -207,7 +207,7 @@ mcview_get_ptr_growing_buffer (mcview_t * view, off_t byte_index)
|
|||
|
||||
assert (view->growbuf_in_use);
|
||||
|
||||
if ((size_t) pageno != pageno)
|
||||
if (pageno < 0)
|
||||
return NULL;
|
||||
|
||||
mcview_growbuf_read_until (view, byte_index + 1);
|
||||
|
@ -215,7 +215,7 @@ mcview_get_ptr_growing_buffer (mcview_t * view, off_t byte_index)
|
|||
return NULL;
|
||||
if (pageno < view->growbuf_blockptr->len - 1)
|
||||
return (char *) (g_ptr_array_index(view->growbuf_blockptr, pageno) + pageindex);
|
||||
if (pageno == view->growbuf_blockptr->len - 1 && pageindex < view->growbuf_lastindex)
|
||||
if (pageno == view->growbuf_blockptr->len - 1 && pageindex < (off_t) view->growbuf_lastindex)
|
||||
return (char *) (g_ptr_array_index(view->growbuf_blockptr, pageno) + pageindex);
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -70,7 +70,7 @@ mcview_may_still_grow (mcview_t * view)
|
|||
static inline gboolean
|
||||
mcview_already_loaded (off_t offset, off_t idx, size_t size)
|
||||
{
|
||||
return (offset <= idx && idx - offset < size);
|
||||
return (offset <= idx && idx - offset < (off_t) size);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
|
|
@ -89,7 +89,7 @@ mcview_find (mcview_t * view, gsize search_start, gsize * len)
|
|||
search_end = search_start + view->search->original_len;
|
||||
|
||||
if (mc_search_run (view->search, (void *) view, search_start, search_end, len)
|
||||
&& view->search->normal_offset == search_start)
|
||||
&& view->search->normal_offset == (off_t) search_start)
|
||||
return TRUE;
|
||||
|
||||
search_start--;
|
||||
|
@ -184,7 +184,7 @@ mcview_search_update_cmd_callback (const void *user_data, gsize char_offset)
|
|||
{
|
||||
mcview_t *view = (mcview_t *) user_data;
|
||||
|
||||
if (char_offset >= view->update_activate) {
|
||||
if (char_offset >= (gsize) view->update_activate) {
|
||||
view->update_activate += view->update_steps;
|
||||
if (verbose) {
|
||||
mcview_percent (view, char_offset);
|
||||
|
|
Loading…
Reference in New Issue