8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-22 20:43:02 +01:00

Got rid of spurious cast.

This commit is contained in:
robocop 2004-09-26 11:23:32 +00:00
parent a14e632b5b
commit 20b38f1aad
8 changed files with 45 additions and 44 deletions

View File

@ -136,7 +136,7 @@ ISC_STATUS API_ROUTINE isc_array_get_slice(ISC_STATUS* status,
0, NULL, *slice_length, array, slice_length);
if (sdl != sdl_buffer)
gds__free((SLONG *) sdl);
gds__free(sdl);
return status[1];
}
@ -235,7 +235,7 @@ ISC_STATUS API_ROUTINE isc_array_put_slice(ISC_STATUS* status,
0, NULL, *slice_length, array);
if (sdl != sdl_buffer)
gds__free((SLONG *) sdl);
gds__free(sdl);
return status[1];
}

View File

@ -150,7 +150,7 @@ bool PREPARSE_execute(
token_length != pp_symbols[PP_CREATE].length ||
strcmp(token, pp_symbols[PP_CREATE].symbol))
{
gds__free((SLONG *) token);
gds__free(token);
return false;
}
@ -161,14 +161,14 @@ bool PREPARSE_execute(
(strcmp(token, pp_symbols[PP_DATABASE].symbol) &&
strcmp(token, pp_symbols[PP_SCHEMA].symbol)))
{
gds__free((SLONG *) token);
gds__free(token);
return false;
}
if (get_token(user_status, STRING, false, &stmt, stmt_end, token,
&token_length))
{
gds__free((SLONG *) token);
gds__free(token);
return true;
}
@ -182,7 +182,7 @@ bool PREPARSE_execute(
user_status[0] = isc_arg_gds;
user_status[1] = isc_virmemexh;
user_status[2] = isc_arg_end;
gds__free((SLONG *) token);
gds__free(token);
return true;
}
@ -311,8 +311,8 @@ bool PREPARSE_execute(
}
if (get_out) {
gds__free((SLONG *) dpb_array);
gds__free((SLONG *) token);
gds__free(dpb_array);
gds__free(token);
return true;
}
}
@ -326,7 +326,8 @@ bool PREPARSE_execute(
FB_API_HANDLE temp_db_handle = 0;
if (!isc_attach_database(user_status, 0, file_name, &temp_db_handle,
dpb_len, dpb_array) ||
user_status[1] != isc_io_error) {
user_status[1] != isc_io_error)
{
if (!user_status[1]) {
// Swallow status from detach.
ISC_STATUS_ARRAY temp_status;
@ -345,8 +346,8 @@ bool PREPARSE_execute(
UTLD_save_status_strings(user_status);
}
if (dpb_array)
gds__free((SLONG *) dpb_array);
gds__free((SLONG *) token);
gds__free(dpb_array);
gds__free(token);
return true;
}
@ -355,8 +356,8 @@ bool PREPARSE_execute(
dpb_array, 0);
if (dpb_array)
gds__free((SLONG *) dpb_array);
gds__free((SLONG *) token);
gds__free(dpb_array);
gds__free(token);
return true;
}

View File

@ -618,7 +618,7 @@ void API_ROUTINE gds__event_counts(
SLONG API_ROUTINE isc_free(SCHAR * blk)
{
return gds__free((SLONG *) blk);
return gds__free(blk);
}
SLONG API_ROUTINE isc_ftof(const SCHAR* string1,

View File

@ -489,7 +489,7 @@ ISC_STATUS filter_text(USHORT action, BlobControl* control)
case isc_blob_filter_close:
if (control->ctl_data[1]) {
gds__free((SLONG *) control->ctl_data[1]);
gds__free((void*) control->ctl_data[1]);
control->ctl_data[1] = 0;
}
return FB_SUCCESS;
@ -573,7 +573,7 @@ ISC_STATUS filter_text(USHORT action, BlobControl* control)
if (control->ctl_data[1]
&& (control->ctl_data[0] > control->ctl_data[3]))
{
gds__free((SLONG *) control->ctl_data[1]);
gds__free((void*) control->ctl_data[1]);
control->ctl_data[1] = 0;
control->ctl_data[3] = 0;
}
@ -818,7 +818,7 @@ ISC_STATUS filter_transliterate_text(USHORT action, BlobControl* control)
case isc_blob_filter_close:
if (aux && aux->ctlaux_buffer1) {
gds__free((SLONG *) aux->ctlaux_buffer1);
gds__free(aux->ctlaux_buffer1);
aux->ctlaux_buffer1 = NULL;
aux->ctlaux_buffer1_len = 0;
}
@ -843,7 +843,7 @@ ISC_STATUS filter_transliterate_text(USHORT action, BlobControl* control)
/* Allocate a new buffer if we don't have enough */
if (result_length > aux->ctlaux_buffer1_len) {
gds__free((SLONG *) aux->ctlaux_buffer1);
gds__free(aux->ctlaux_buffer1);
aux->ctlaux_buffer1_len = result_length;
aux->ctlaux_buffer1 = (BYTE *) gds__alloc((SLONG) result_length);
/* FREE: above & isc_blob_filter_close in this routine */

View File

@ -950,7 +950,7 @@ int ISC_expand_share(const TEXT* file_name, TEXT* expanded_name)
DWORD ret = WNetEnumResource(handle, &nument, resources, &size);
if (ret == ERROR_MORE_DATA) {
gds__free((UCHAR *) resources);
gds__free(resources);
resources = (LPNETRESOURCE) gds__alloc((SLONG) size);
/* FREE: in this routine */
if (!resources) /* NOMEM: don't expand the filename */
@ -978,7 +978,7 @@ int ISC_expand_share(const TEXT* file_name, TEXT* expanded_name)
ret =
WNetGetUniversalName(device, REMOTE_NAME_INFO_LEVEL, res2, &size);
if (ret == ERROR_MORE_DATA) {
gds__free((UCHAR *) resources);
gds__free(resources);
resources = (LPNETRESOURCE) gds__alloc((SLONG) size);
if (!resources) /* NOMEM: don't expand the filename */
return strlen(expanded_name);
@ -993,7 +993,7 @@ int ISC_expand_share(const TEXT* file_name, TEXT* expanded_name)
if (resources)
gds__free((UCHAR *) resources);
gds__free(resources);
return strlen(expanded_name);
}
#endif // WIN_NT

View File

@ -627,28 +627,28 @@ Service* SVC_attach(USHORT service_length,
}
if (spb_buf) {
gds__free((SLONG *) spb_buf);
gds__free(spb_buf);
}
if (misc != misc_buf) {
gds__free((SLONG *) misc);
gds__free(misc);
}
} // try
catch (const std::exception&) {
if (spb_buf) {
gds__free((SLONG *) spb_buf);
gds__free(spb_buf);
}
if (misc && misc != misc_buf) {
gds__free((SLONG *) misc);
gds__free(misc);
}
if (switches) {
gds__free((SLONG *) switches);
gds__free(switches);
}
if (service) {
if (service->svc_status) {
gds__free((SLONG *) service->svc_status);
gds__free(service->svc_status);
}
// gds__free((SLONG *) service);
// gds__free(service);
delete service;
}
throw;
@ -1187,7 +1187,7 @@ ISC_STATUS SVC_query2(Service* service,
if (l > service->svc_resp_buf_len) {
THREAD_ENTER();
if (service->svc_resp_buf)
gds__free((SLONG *) service->svc_resp_buf);
gds__free(service->svc_resp_buf);
service->svc_resp_buf = (UCHAR *) gds__alloc((SLONG) l);
/* FREE: in SVC_detach() */
if (!service->svc_resp_buf) { /* NOMEM: */
@ -1607,7 +1607,7 @@ void SVC_query(Service* service,
{
THREAD_ENTER();
if (service->svc_resp_buf)
gds__free((SLONG *) service->svc_resp_buf);
gds__free(service->svc_resp_buf);
service->svc_resp_buf = (UCHAR *) gds__alloc((SLONG) l);
/* FREE: in SVC_detach() */
if (!service->svc_resp_buf)
@ -2022,10 +2022,10 @@ void* SVC_start(Service* service, USHORT spb_length, const SCHAR* spb)
} // try
catch (const std::exception&) {
if (service->svc_switches) {
gds__free((SLONG *) service->svc_switches);
gds__free(service->svc_switches);
}
if (service) {
// gds__free((SLONG *) service);
// gds__free(service);
delete service;
}
throw;
@ -2438,7 +2438,7 @@ static void service_fork(TEXT* service_path, Service* service)
THREAD_ENTER();
if (argv_data != argv_data_buf)
gds__free((SLONG *) argv_data);
gds__free(argv_data);
if (!ret)
ERR_post(isc_sys_request, isc_arg_string, "CreateProcess", SYS_ERR,
@ -3249,29 +3249,29 @@ void SVC_cleanup(Service* service)
#else
if (service->svc_stdout) {
gds__free((SLONG *) service->svc_stdout);
gds__free(service->svc_stdout);
service->svc_stdout = NULL;
}
if (service->svc_argv) {
gds__free((SLONG *) service->svc_argv);
gds__free(service->svc_argv);
service->svc_argv = NULL;
}
#endif
if (service->svc_resp_buf)
gds__free((SLONG *) service->svc_resp_buf);
gds__free(service->svc_resp_buf);
if (service->svc_switches != NULL)
gds__free((SLONG *) service->svc_switches);
gds__free(service->svc_switches);
if (service->svc_status != NULL)
gds__free((SLONG *) service->svc_status);
gds__free(service->svc_status);
#ifdef WIN_NT
CloseHandle((HANDLE) service->svc_handle);
#endif
// gds__free((SLONG *) service);
// gds__free(service);
delete service;
}

View File

@ -1241,7 +1241,7 @@ int API_ROUTINE isc_version(FB_API_HANDLE* handle,
buf_len, reinterpret_cast<char*>(buf)))
{
if (buf != buffer)
gds__free((SLONG *) buf);
gds__free(buf);
return FB_FAILURE;
}
@ -1267,7 +1267,7 @@ int API_ROUTINE isc_version(FB_API_HANDLE* handle,
default:
if (buf != buffer)
gds__free((SLONG *) buf);
gds__free(buf);
return FB_FAILURE;
}
p += len;
@ -1278,7 +1278,7 @@ int API_ROUTINE isc_version(FB_API_HANDLE* handle,
*/
if (redo) {
if (buf != buffer)
gds__free((SLONG *) buf);
gds__free(buf);
buf_len += 1024;
buf = (UCHAR *) gds__alloc((SLONG) (sizeof(UCHAR) * buf_len));
/* FREE: freed within this module */
@ -1317,7 +1317,7 @@ int API_ROUTINE isc_version(FB_API_HANDLE* handle,
}
if (buf != buffer)
gds__free((SLONG *) buf);
gds__free(buf);
USHORT ods_version, ods_minor_version;
if (get_ods_version(handle, &ods_version, &ods_minor_version) == FB_FAILURE)

View File

@ -348,7 +348,7 @@ int common_main(int argc,
if (tdsec->tsec_user_data != NULL)
{
gds__free((SLONG *) tdsec->tsec_user_data);
gds__free(tdsec->tsec_user_data);
}
/* All returns occur from this point - even normal returns */