mirror of
https://github.com/QuasarApp/zip.git
synced 2025-05-21 15:49:33 +00:00
clang-format
This commit is contained in:
parent
5b679e68a0
commit
b2fc08e6b7
14
src/miniz.h
14
src/miniz.h
@ -4117,9 +4117,9 @@ void *tdefl_write_image_to_png_file_in_memory(const void *pImage, int w, int h,
|
|||||||
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
static wchar_t* str2wstr(const char *str) {
|
static wchar_t *str2wstr(const char *str) {
|
||||||
int len = strlen(str) + 1;
|
int len = strlen(str) + 1;
|
||||||
wchar_t* wstr = malloc(len * sizeof(wchar_t));
|
wchar_t *wstr = malloc(len * sizeof(wchar_t));
|
||||||
MultiByteToWideChar(CP_UTF8, 0, str, len * sizeof(char), wstr, len);
|
MultiByteToWideChar(CP_UTF8, 0, str, len * sizeof(char), wstr, len);
|
||||||
return wstr;
|
return wstr;
|
||||||
}
|
}
|
||||||
@ -4127,8 +4127,8 @@ static wchar_t* str2wstr(const char *str) {
|
|||||||
static FILE *mz_fopen(const char *pFilename, const char *pMode) {
|
static FILE *mz_fopen(const char *pFilename, const char *pMode) {
|
||||||
FILE *pFile = NULL;
|
FILE *pFile = NULL;
|
||||||
|
|
||||||
wchar_t* wFilename = str2wstr(pFilename);
|
wchar_t *wFilename = str2wstr(pFilename);
|
||||||
wchar_t* wMode = str2wstr(pMode);
|
wchar_t *wMode = str2wstr(pMode);
|
||||||
_wfopen_s(&pFile, wFilename, wMode);
|
_wfopen_s(&pFile, wFilename, wMode);
|
||||||
free(wFilename);
|
free(wFilename);
|
||||||
free(wMode);
|
free(wMode);
|
||||||
@ -4139,14 +4139,14 @@ static FILE *mz_fopen(const char *pFilename, const char *pMode) {
|
|||||||
static FILE *mz_freopen(const char *pPath, const char *pMode, FILE *pStream) {
|
static FILE *mz_freopen(const char *pPath, const char *pMode, FILE *pStream) {
|
||||||
FILE *pFile = NULL;
|
FILE *pFile = NULL;
|
||||||
|
|
||||||
wchar_t* wPath = str2wstr(pPath);
|
wchar_t *wPath = str2wstr(pPath);
|
||||||
wchar_t* wMode = str2wstr(pMode);
|
wchar_t *wMode = str2wstr(pMode);
|
||||||
int res = _wfreopen_s(&pFile, wPath, wMode, pStream);
|
int res = _wfreopen_s(&pFile, wPath, wMode, pStream);
|
||||||
free(wPath);
|
free(wPath);
|
||||||
free(wMode);
|
free(wMode);
|
||||||
|
|
||||||
if (res)
|
if (res)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
return pFile;
|
return pFile;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user