From 6eaa7786b5d46e771154ebd7fdd23d53ba7e6265 Mon Sep 17 00:00:00 2001 From: cloudwalk Date: Sat, 6 Mar 2021 12:03:21 +0000 Subject: [PATCH] sys: Rename Sys_UnloadLibrary to Sys_FreeLibrary for consistency git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@13095 d7cf8633-e32d-0410-b094-e92efae38249 --- av_backend_libav.c | 2 +- cap_ogg.c | 8 ++++---- cl_video_libavw.c | 4 ++-- crypto.c | 4 ++-- fs.c | 8 ++++---- ft2.c | 2 +- image_png.c | 6 +++--- jpeg.c | 2 +- libcurl.c | 2 +- snd_ogg.c | 4 ++-- snd_xmp.c | 4 ++-- sys.h | 2 +- sys_shared.c | 8 ++++---- world.c | 4 ++-- 14 files changed, 30 insertions(+), 30 deletions(-) diff --git a/av_backend_libav.c b/av_backend_libav.c index 36bfbdf4..db9f5609 100644 --- a/av_backend_libav.c +++ b/av_backend_libav.c @@ -294,7 +294,7 @@ qbool LibAV_LoadLibrary(void) if(Sys_LoadLibrary(dllnames_libavformat, &libavformat_dll, libavformatfuncs)) return true; Con_Printf(CON_ERROR "Failed to load the libavformat library. Cannot use libavcodec without it\n"); - Sys_UnloadLibrary(&libavcodec_dll); + Sys_FreeLibrary(&libavcodec_dll); } return false; diff --git a/cap_ogg.c b/cap_ogg.c index 16802dc9..0a0c1634 100644 --- a/cap_ogg.c +++ b/cap_ogg.c @@ -596,10 +596,10 @@ qbool SCR_CaptureVideo_Ogg_Available(void) void SCR_CaptureVideo_Ogg_CloseDLL(void) { - Sys_UnloadLibrary (&ve_dll); - Sys_UnloadLibrary (&vo_dll); - Sys_UnloadLibrary (&th_dll); - Sys_UnloadLibrary (&og_dll); + Sys_FreeLibrary (&ve_dll); + Sys_FreeLibrary (&vo_dll); + Sys_FreeLibrary (&th_dll); + Sys_FreeLibrary (&og_dll); } // this struct should not be needed diff --git a/cl_video_libavw.c b/cl_video_libavw.c index 10e47562..f85148a8 100644 --- a/cl_video_libavw.c +++ b/cl_video_libavw.c @@ -372,7 +372,7 @@ qbool LibAvW_OpenLibrary(void) if ((errorcode = qLibAvW_Init(&libavw_message))) { Con_Printf(CON_ERROR "LibAvW failed to initialize: %s\n", qLibAvW_ErrorString(errorcode)); - Sys_UnloadLibrary(&libavw_dll); + Sys_FreeLibrary(&libavw_dll); } Cvar_RegisterVariable(&cl_video_libavw_minwidth); @@ -384,5 +384,5 @@ qbool LibAvW_OpenLibrary(void) void LibAvW_CloseLibrary(void) { - Sys_UnloadLibrary(&libavw_dll); + Sys_FreeLibrary(&libavw_dll); } diff --git a/crypto.c b/crypto.c index cb241efd..af34b385 100644 --- a/crypto.c +++ b/crypto.c @@ -284,7 +284,7 @@ static qbool Crypto_OpenLibrary (void) static void Crypto_CloseLibrary (void) { - Sys_UnloadLibrary (&d0_blind_id_dll); + Sys_FreeLibrary (&d0_blind_id_dll); } #endif @@ -353,7 +353,7 @@ static qbool Crypto_Rijndael_OpenLibrary (void) static void Crypto_Rijndael_CloseLibrary (void) { - Sys_UnloadLibrary (&d0_rijndael_dll); + Sys_FreeLibrary (&d0_rijndael_dll); } #endif diff --git a/fs.c b/fs.c index 26949074..58e9de4b 100644 --- a/fs.c +++ b/fs.c @@ -495,7 +495,7 @@ Unload the Zlib DLL static void PK3_CloseLibrary (void) { #ifndef LINK_TO_ZLIB - Sys_UnloadLibrary (&zlib_dll); + Sys_FreeLibrary (&zlib_dll); #endif } @@ -2218,9 +2218,9 @@ void FS_Shutdown (void) PK3_CloseLibrary (); #ifdef WIN32 - Sys_UnloadLibrary (&shfolder_dll); - Sys_UnloadLibrary (&shell32_dll); - Sys_UnloadLibrary (&ole32_dll); + Sys_FreeLibrary (&shfolder_dll); + Sys_FreeLibrary (&shell32_dll); + Sys_FreeLibrary (&ole32_dll); #endif if (fs_mutex) diff --git a/ft2.c b/ft2.c index 0b738108..2df99bcb 100644 --- a/ft2.c +++ b/ft2.c @@ -327,7 +327,7 @@ void Font_CloseLibrary (void) font_ft2lib = NULL; } #ifndef DP_FREETYPE_STATIC - Sys_UnloadLibrary (&ft2_dll); + Sys_FreeLibrary (&ft2_dll); #endif pp.buf = NULL; } diff --git a/image_png.c b/image_png.c index 5562ceda..f7db48aa 100644 --- a/image_png.c +++ b/image_png.c @@ -177,7 +177,7 @@ qbool PNG_OpenLibrary (void) if(qpng_access_version_number() / 100 >= 104) if(!Sys_LoadLibrary (dllnames, &png14_dll, png14funcs)) { - Sys_UnloadLibrary (&png_dll); + Sys_FreeLibrary (&png_dll); return false; } return true; @@ -193,8 +193,8 @@ Unload the PNG DLL */ void PNG_CloseLibrary (void) { - Sys_UnloadLibrary (&png14_dll); - Sys_UnloadLibrary (&png_dll); + Sys_FreeLibrary (&png14_dll); + Sys_FreeLibrary (&png_dll); } /* diff --git a/jpeg.c b/jpeg.c index 8d6ceec2..1e247a66 100644 --- a/jpeg.c +++ b/jpeg.c @@ -538,7 +538,7 @@ Unload the JPEG DLL void JPEG_CloseLibrary (void) { #ifndef LINK_TO_LIBJPEG - Sys_UnloadLibrary (&jpeg_dll); + Sys_FreeLibrary (&jpeg_dll); jpeg_tried_loading = false; // allow retry #endif } diff --git a/libcurl.c b/libcurl.c index 9373d21a..cd6d8279 100644 --- a/libcurl.c +++ b/libcurl.c @@ -390,7 +390,7 @@ Unload the cURL DLL */ static void CURL_CloseLibrary (void) { - Sys_UnloadLibrary (&curl_dll); + Sys_FreeLibrary (&curl_dll); } diff --git a/snd_ogg.c b/snd_ogg.c index 540966d4..39c09b5b 100644 --- a/snd_ogg.c +++ b/snd_ogg.c @@ -319,8 +319,8 @@ Unload the VorbisFile DLL */ void OGG_CloseLibrary (void) { - Sys_UnloadLibrary (&vf_dll); - Sys_UnloadLibrary (&vo_dll); + Sys_FreeLibrary (&vf_dll); + Sys_FreeLibrary (&vo_dll); } #endif diff --git a/snd_xmp.c b/snd_xmp.c index 85a58ef8..6be0bfe5 100644 --- a/snd_xmp.c +++ b/snd_xmp.c @@ -376,7 +376,7 @@ qbool XMP_OpenLibrary (void) if (*qxmp_vercode < 0x040200) { Con_Printf("Found incompatible XMP library version %s, not loading. (4.2.0 or higher required)\n", *qxmp_version); - Sys_UnloadLibrary (&xmp_dll); + Sys_FreeLibrary (&xmp_dll); return false; } if (developer_loading.integer >= 1) @@ -397,7 +397,7 @@ Unload the libxmp DLL */ void XMP_CloseLibrary (void) { - Sys_UnloadLibrary (&xmp_dll); + Sys_FreeLibrary (&xmp_dll); } #endif diff --git a/sys.h b/sys.h index df7e81ae..b606315d 100644 --- a/sys.h +++ b/sys.h @@ -179,7 +179,7 @@ qbool Sys_LoadSelf(dllhandle_t *handle); * \param fcts */ qbool Sys_LoadLibrary (const char** dllnames, dllhandle_t* handle, const dllfunction_t *fcts); -void Sys_UnloadLibrary (dllhandle_t* handle); +void Sys_FreeLibrary (dllhandle_t* handle); void* Sys_GetProcAddress (dllhandle_t handle, const char* name); int Sys_CheckParm (const char *parm); diff --git a/sys_shared.c b/sys_shared.c index 2149dff6..985af903 100644 --- a/sys_shared.c +++ b/sys_shared.c @@ -151,7 +151,7 @@ qbool Sys_LoadLibrary (const char** dllnames, dllhandle_t* handle, const dllfunc return true; } else - Sys_UnloadLibrary(&dllhandle); + Sys_FreeLibrary(&dllhandle); notfound: #endif #endif @@ -181,7 +181,7 @@ notfound: if (Sys_LoadLibraryFunctions(dllhandle, fcts, true, (dllnames[i+1] != NULL) || (strrchr(sys.argv[0], '/')))) break; else - Sys_UnloadLibrary (&dllhandle); + Sys_FreeLibrary (&dllhandle); } // see if the names can be loaded relative to the executable path @@ -205,7 +205,7 @@ notfound: if (Sys_LoadLibraryFunctions(dllhandle, fcts, true, dllnames[i+1] != NULL)) break; else - Sys_UnloadLibrary (&dllhandle); + Sys_FreeLibrary (&dllhandle); } } @@ -226,7 +226,7 @@ notfound: #endif } -void Sys_UnloadLibrary (dllhandle_t* handle) +void Sys_FreeLibrary (dllhandle_t* handle) { #ifdef SUPPORTDLL if (handle == NULL || *handle == NULL) diff --git a/world.c b/world.c index 42ed670d..76ef3a7a 100644 --- a/world.c +++ b/world.c @@ -1539,7 +1539,7 @@ static void World_Physics_Init(void) # else Con_Printf("ODE library not compiled for double precision - incompatible! Not using ODE physics.\n"); # endif - Sys_UnloadLibrary(&ode_dll); + Sys_FreeLibrary(&ode_dll); ode_dll = NULL; } else @@ -1565,7 +1565,7 @@ static void World_Physics_Shutdown(void) { dCloseODE(); #ifndef LINK_TO_LIBODE - Sys_UnloadLibrary(&ode_dll); + Sys_FreeLibrary(&ode_dll); ode_dll = NULL; #endif } -- 2.39.2