Fixed some minor merging issues

This commit is contained in:
Jim Monte 2020-03-08 03:32:56 -04:00
parent 721bc05a43
commit 9b940e5d01
2 changed files with 8 additions and 6 deletions

View File

@ -161,8 +161,9 @@ int WIN_Init(void)
TheWndClass.cbClsExtra = 0;
TheWndClass.cbWndExtra = sizeof(GRAPH *);
if (!RegisterClass(&TheWndClass))
if (!RegisterClass(&TheWndClass)) {
return 1;
}
#else
/* register window class */
@ -179,8 +180,9 @@ int WIN_Init(void)
TheWndClassW.hIcon = LoadIconW(hInst, MAKEINTRESOURCEW(2));
TheWndClassW.cbClsExtra = 0;
TheWndClassW.cbWndExtra = sizeof(GRAPH *);
if (!RegisterClassW(&TheWndClassW))
return 1;
if (!RegisterClassW(&TheWndClassW)) {
return 1;
}
#endif
IsRegistered = 1;
}

View File

@ -86,7 +86,7 @@ int ds_init(DSTRING *p_ds, char *p_buf, size_t length_string,
void ds_free(DSTRING *p_ds)
{
if (p_ds->p_buf != p_ds->p_stack_buf) {
txfree((void *) p_ds->p_buf);
free((void *) p_ds->p_buf);
}
} /* end of function ds_free */
@ -230,7 +230,7 @@ static int ds_reserve_internal(DSTRING *p_ds,
/* If there already was a dynamic allocation, free it */
if (p_ds->p_buf != p_ds->p_stack_buf) {
txfree((void *) p_ds->p_buf);
free((void *) p_ds->p_buf);
}
/* Assign new active buffer and its size */
@ -335,7 +335,7 @@ int ds_compact(DSTRING *p_ds)
* free the allocation. */
if (p_ds->n_byte_stack_buf >= n_byte_alloc_min) {
(void) memcpy(p_ds->p_stack_buf, p_ds->p_buf, n_byte_alloc_min);
txfree((void *) p_ds->p_buf);
free((void *) p_ds->p_buf);
p_ds->p_buf = p_ds->p_stack_buf;
p_ds->n_byte_alloc = p_ds->n_byte_stack_buf;
return DS_E_OK;