* view.c (view_free_growing_buffer): Renamed to
view_growbuf_free(). Simplified the code.
Этот коммит содержится в:
родитель
f6e6c6e80d
Коммит
1c367fbab4
@ -4,6 +4,8 @@
|
|||||||
ds_file_datasize to be a power of two.
|
ds_file_datasize to be a power of two.
|
||||||
* view.c (struct WView): Renamed nib_shift to hexedit_lownibble.
|
* view.c (struct WView): Renamed nib_shift to hexedit_lownibble.
|
||||||
Replaced 0 literals with FALSE.
|
Replaced 0 literals with FALSE.
|
||||||
|
* view.c (view_free_growing_buffer): Renamed to
|
||||||
|
view_growbuf_free(). Simplified the code.
|
||||||
|
|
||||||
2005-04-18 Roland Illig <roland.illig@gmx.de>
|
2005-04-18 Roland Illig <roland.illig@gmx.de>
|
||||||
|
|
||||||
|
25
src/view.c
25
src/view.c
@ -2826,20 +2826,17 @@ view_update_last_byte (WView *view)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
view_free_growing_buffer (WView *view)
|
view_growbuf_free (WView *view)
|
||||||
{
|
{
|
||||||
if (view->growbuf_in_use) {
|
size_t i;
|
||||||
/* block_ptr may be zero if the file was a file with 0 bytes */
|
|
||||||
if (view->growbuf_blockptr) {
|
|
||||||
size_t i;
|
|
||||||
|
|
||||||
for (i = 0; i < view->growbuf_blocks; i++)
|
assert (view->growbuf_in_use);
|
||||||
g_free (view->growbuf_blockptr[i]);
|
|
||||||
g_free (view->growbuf_blockptr);
|
for (i = 0; i < view->growbuf_blocks; i++)
|
||||||
view->growbuf_blockptr = NULL;
|
g_free (view->growbuf_blockptr[i]);
|
||||||
}
|
g_free (view->growbuf_blockptr);
|
||||||
view->growbuf_in_use = FALSE;
|
view->growbuf_blockptr = NULL;
|
||||||
}
|
view->growbuf_in_use = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -2854,14 +2851,14 @@ view_close_datasource (WView *view)
|
|||||||
close_error_pipe (0, NULL);
|
close_error_pipe (0, NULL);
|
||||||
view->ds_stdio_pipe = NULL;
|
view->ds_stdio_pipe = NULL;
|
||||||
}
|
}
|
||||||
view_free_growing_buffer (view);
|
view_growbuf_free (view);
|
||||||
break;
|
break;
|
||||||
case DS_VFS_PIPE:
|
case DS_VFS_PIPE:
|
||||||
if (view->ds_vfs_pipe != -1) {
|
if (view->ds_vfs_pipe != -1) {
|
||||||
(void) mc_close (view->ds_vfs_pipe);
|
(void) mc_close (view->ds_vfs_pipe);
|
||||||
view->ds_vfs_pipe = -1;
|
view->ds_vfs_pipe = -1;
|
||||||
}
|
}
|
||||||
view_free_growing_buffer (view);
|
view_growbuf_free (view);
|
||||||
break;
|
break;
|
||||||
case DS_FILE:
|
case DS_FILE:
|
||||||
(void) mc_close (view->ds_file_fd);
|
(void) mc_close (view->ds_file_fd);
|
||||||
|
Загрузка…
Ссылка в новой задаче
Block a user