{
dVAR;
PerlInterpreter *const from = param->proto_perl;
- PerlInterpreter *const to = PERL_GET_THX;
+ PerlInterpreter *const to = (PerlInterpreter *)PERL_GET_THX;
long pos;
DIR *dup;
size_t wlen = wcslen(wstr) + 1;
int len = WideCharToMultiByte(CP_ACP, WC_NO_BEST_FIT_CHARS, wstr, wlen,
NULL, 0, NULL, NULL);
- char* str = malloc(len);
+ char* str = (char*)malloc(len);
if (!str)
out_of_memory();
WideCharToMultiByte(CP_ACP, WC_NO_BEST_FIT_CHARS, wstr, wlen,
size_t widelen = wcslen(widename)+1;
int len = WideCharToMultiByte(CP_ACP, WC_NO_BEST_FIT_CHARS, widename, widelen,
NULL, 0, NULL, NULL);
- name = win32_malloc(len);
+ name = (char*)win32_malloc(len);
if (!name)
out_of_memory();
if (use_default) {
DWORD shortlen = GetShortPathNameW(widename, NULL, 0);
if (shortlen) {
- WCHAR *shortname = win32_malloc(shortlen*sizeof(WCHAR));
+ WCHAR *shortname = (WCHAR*)win32_malloc(shortlen*sizeof(WCHAR));
if (!shortname)
out_of_memory();
shortlen = GetShortPathNameW(widename, shortname, shortlen)+1;
len = WideCharToMultiByte(CP_ACP, WC_NO_BEST_FIT_CHARS, shortname, shortlen,
NULL, 0, NULL, NULL);
- name = win32_realloc(name, len);
+ name = (char*)win32_realloc(name, len);
if (!name)
out_of_memory();
WideCharToMultiByte(CP_ACP, WC_NO_BEST_FIT_CHARS, shortname, shortlen,
{
dTHX;
char buf[MAX_PATH+1];
- char *first;
+ const char *first;
/* LoadLibrary() doesn't recognize forward slashes correctly,
* so turn 'em back. */
/* fetch Unicode version of PATH */
len = 2000;
- wide_path = win32_malloc(len*sizeof(WCHAR));
+ wide_path = (WCHAR*)win32_malloc(len*sizeof(WCHAR));
while (wide_path) {
size_t newlen = GetEnvironmentVariableW(L"PATH", wide_path, len);
if (newlen < len)
break;
len = newlen;
- wide_path = win32_realloc(wide_path, len*sizeof(WCHAR));
+ wide_path = (WCHAR*)win32_realloc(wide_path, len*sizeof(WCHAR));
}
if (!wide_path)
return;
ansi_len = strlen(ansi_dir);
if (ansi_path) {
size_t newlen = len + 1 + ansi_len;
- ansi_path = win32_realloc(ansi_path, newlen+1);
+ ansi_path = (char*)win32_realloc(ansi_path, newlen+1);
if (!ansi_path)
break;
ansi_path[len] = ';';
}
else {
len = ansi_len;
- ansi_path = win32_malloc(5+len+1);
+ ansi_path = (char*)win32_malloc(5+len+1);
if (!ansi_path)
break;
memcpy(ansi_path, "PATH=", 5);
{
PerlIOWin32 *os = PerlIOSelf(f,PerlIOWin32);
HANDLE proc = GetCurrentProcess();
- HANDLE new;
- if (DuplicateHandle(proc, os->h, proc, &new, 0, FALSE, DUPLICATE_SAME_ACCESS))
+ HANDLE new_h;
+ if (DuplicateHandle(proc, os->h, proc, &new_h, 0, FALSE, DUPLICATE_SAME_ACCESS))
{
char mode[8];
- int fd = win32_open_osfhandle((intptr_t) new, PerlIOUnix_oflags(PerlIO_modestr(o,mode)));
+ int fd = win32_open_osfhandle((intptr_t) new_h, PerlIOUnix_oflags(PerlIO_modestr(o,mode)));
if (fd >= 0)
{
f = PerlIOBase_dup(aTHX_ f, o, params, flags);
if (f)
{
PerlIOWin32 *fs = PerlIOSelf(f,PerlIOWin32);
- fs->h = new;
+ fs->h = new_h;
fs->fd = fd;
fs->refcnt = 1;
fdtable[fd] = fs;
}
else
{
- CloseHandle(new);
+ CloseHandle(new_h);
}
}
return f;