Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
9d4f32e8
Commit
9d4f32e8
authored
Oct 14, 2010
by
Juanma Barranquero
Browse files
src/w32*.c: Whitespace fixes and typos.
parent
9650fc61
Changes
12
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
248 additions
and
249 deletions
+248
-249
src/w32.c
src/w32.c
+141
-149
src/w32console.c
src/w32console.c
+14
-14
src/w32fns.c
src/w32fns.c
+2
-5
src/w32font.c
src/w32font.c
+9
-9
src/w32heap.c
src/w32heap.c
+1
-1
src/w32inevt.c
src/w32inevt.c
+2
-2
src/w32menu.c
src/w32menu.c
+12
-9
src/w32proc.c
src/w32proc.c
+21
-16
src/w32select.c
src/w32select.c
+19
-19
src/w32term.c
src/w32term.c
+17
-15
src/w32uniscribe.c
src/w32uniscribe.c
+8
-7
src/w32xfns.c
src/w32xfns.c
+2
-3
No files found.
src/w32.c
View file @
9d4f32e8
...
...
@@ -315,8 +315,8 @@ is_windows_9x ()
if
(
g_b_init_is_windows_9x
==
0
)
{
g_b_init_is_windows_9x
=
1
;
ZeroMemory
(
&
os_ver
,
sizeof
(
OSVERSIONINFO
));
os_ver
.
dwOSVersionInfoSize
=
sizeof
(
OSVERSIONINFO
);
ZeroMemory
(
&
os_ver
,
sizeof
(
OSVERSIONINFO
));
os_ver
.
dwOSVersionInfoSize
=
sizeof
(
OSVERSIONINFO
);
if
(
GetVersionEx
(
&
os_ver
))
{
s_b_ret
=
(
os_ver
.
dwPlatformId
==
VER_PLATFORM_WIN32_WINDOWS
);
...
...
@@ -334,7 +334,7 @@ w32_get_internal_run_time ()
if
(
get_process_times_fn
)
{
FILETIME
create
,
exit
,
kernel
,
user
;
HANDLE
proc
=
GetCurrentProcess
();
HANDLE
proc
=
GetCurrentProcess
();
if
((
*
get_process_times_fn
)
(
proc
,
&
create
,
&
exit
,
&
kernel
,
&
user
))
{
LARGE_INTEGER
user_int
,
kernel_int
,
total
;
...
...
@@ -367,8 +367,8 @@ w32_get_internal_run_time ()
/* ** The wrapper functions ** */
BOOL
WINAPI
open_process_token
(
HANDLE
ProcessHandle
,
BOOL
WINAPI
open_process_token
(
HANDLE
ProcessHandle
,
DWORD
DesiredAccess
,
PHANDLE
TokenHandle
)
{
...
...
@@ -397,8 +397,8 @@ BOOL WINAPI open_process_token (
);
}
BOOL
WINAPI
get_token_information
(
HANDLE
TokenHandle
,
BOOL
WINAPI
get_token_information
(
HANDLE
TokenHandle
,
TOKEN_INFORMATION_CLASS
TokenInformationClass
,
LPVOID
TokenInformation
,
DWORD
TokenInformationLength
,
...
...
@@ -431,8 +431,8 @@ BOOL WINAPI get_token_information (
);
}
BOOL
WINAPI
lookup_account_sid
(
LPCTSTR
lpSystemName
,
BOOL
WINAPI
lookup_account_sid
(
LPCTSTR
lpSystemName
,
PSID
Sid
,
LPTSTR
Name
,
LPDWORD
cbName
,
...
...
@@ -469,8 +469,8 @@ BOOL WINAPI lookup_account_sid (
);
}
PSID_IDENTIFIER_AUTHORITY
WINAPI
get_sid_identifier_authority
(
PSID
pSid
)
PSID_IDENTIFIER_AUTHORITY
WINAPI
get_sid_identifier_authority
(
PSID
pSid
)
{
static
GetSidIdentifierAuthority_Proc
s_pfn_Get_Sid_Identifier_Authority
=
NULL
;
HMODULE
hm_advapi32
=
NULL
;
...
...
@@ -493,9 +493,8 @@ PSID_IDENTIFIER_AUTHORITY WINAPI get_sid_identifier_authority (
return
(
s_pfn_Get_Sid_Identifier_Authority
(
pSid
));
}
PDWORD
WINAPI
get_sid_sub_authority
(
PSID
pSid
,
DWORD
n
)
PDWORD
WINAPI
get_sid_sub_authority
(
PSID
pSid
,
DWORD
n
)
{
static
GetSidSubAuthority_Proc
s_pfn_Get_Sid_Sub_Authority
=
NULL
;
static
DWORD
zero
=
0U
;
...
...
@@ -519,8 +518,8 @@ PDWORD WINAPI get_sid_sub_authority (
return
(
s_pfn_Get_Sid_Sub_Authority
(
pSid
,
n
));
}
PUCHAR
WINAPI
get_sid_sub_authority_count
(
PSID
pSid
)
PUCHAR
WINAPI
get_sid_sub_authority_count
(
PSID
pSid
)
{
static
GetSidSubAuthorityCount_Proc
s_pfn_Get_Sid_Sub_Authority_Count
=
NULL
;
static
UCHAR
zero
=
0U
;
...
...
@@ -544,8 +543,8 @@ PUCHAR WINAPI get_sid_sub_authority_count (
return
(
s_pfn_Get_Sid_Sub_Authority_Count
(
pSid
));
}
BOOL
WINAPI
get_file_security
(
LPCTSTR
lpFileName
,
BOOL
WINAPI
get_file_security
(
LPCTSTR
lpFileName
,
SECURITY_INFORMATION
RequestedInformation
,
PSECURITY_DESCRIPTOR
pSecurityDescriptor
,
DWORD
nLength
,
...
...
@@ -574,8 +573,8 @@ BOOL WINAPI get_file_security (
lpnLengthNeeded
));
}
BOOL
WINAPI
get_security_descriptor_owner
(
PSECURITY_DESCRIPTOR
pSecurityDescriptor
,
BOOL
WINAPI
get_security_descriptor_owner
(
PSECURITY_DESCRIPTOR
pSecurityDescriptor
,
PSID
*
pOwner
,
LPBOOL
lpbOwnerDefaulted
)
{
...
...
@@ -601,8 +600,8 @@ BOOL WINAPI get_security_descriptor_owner (
lpbOwnerDefaulted
));
}
BOOL
WINAPI
get_security_descriptor_group
(
PSECURITY_DESCRIPTOR
pSecurityDescriptor
,
BOOL
WINAPI
get_security_descriptor_group
(
PSECURITY_DESCRIPTOR
pSecurityDescriptor
,
PSID
*
pGroup
,
LPBOOL
lpbGroupDefaulted
)
{
...
...
@@ -628,8 +627,8 @@ BOOL WINAPI get_security_descriptor_group (
lpbGroupDefaulted
));
}
BOOL
WINAPI
is_valid_sid
(
PSID
sid
)
BOOL
WINAPI
is_valid_sid
(
PSID
sid
)
{
static
IsValidSid_Proc
s_pfn_Is_Valid_Sid
=
NULL
;
HMODULE
hm_advapi32
=
NULL
;
...
...
@@ -652,9 +651,8 @@ BOOL WINAPI is_valid_sid (
return
(
s_pfn_Is_Valid_Sid
(
sid
));
}
BOOL
WINAPI
equal_sid
(
PSID
sid1
,
PSID
sid2
)
BOOL
WINAPI
equal_sid
(
PSID
sid1
,
PSID
sid2
)
{
static
EqualSid_Proc
s_pfn_Equal_Sid
=
NULL
;
HMODULE
hm_advapi32
=
NULL
;
...
...
@@ -677,8 +675,8 @@ BOOL WINAPI equal_sid (
return
(
s_pfn_Equal_Sid
(
sid1
,
sid2
));
}
DWORD
WINAPI
get_length_sid
(
PSID
sid
)
DWORD
WINAPI
get_length_sid
(
PSID
sid
)
{
static
GetLengthSid_Proc
s_pfn_Get_Length_Sid
=
NULL
;
HMODULE
hm_advapi32
=
NULL
;
...
...
@@ -701,10 +699,8 @@ DWORD WINAPI get_length_sid (
return
(
s_pfn_Get_Length_Sid
(
sid
));
}
BOOL
WINAPI
copy_sid
(
DWORD
destlen
,
PSID
dest
,
PSID
src
)
BOOL
WINAPI
copy_sid
(
DWORD
destlen
,
PSID
dest
,
PSID
src
)
{
static
CopySid_Proc
s_pfn_Copy_Sid
=
NULL
;
HMODULE
hm_advapi32
=
NULL
;
...
...
@@ -733,8 +729,8 @@ BOOL WINAPI copy_sid (
supported in Windows NT / 2k / XP
*/
void
WINAPI
get_native_system_info
(
LPSYSTEM_INFO
lpSystemInfo
)
void
WINAPI
get_native_system_info
(
LPSYSTEM_INFO
lpSystemInfo
)
{
static
GetNativeSystemInfo_Proc
s_pfn_Get_Native_System_Info
=
NULL
;
if
(
is_windows_9x
()
!=
TRUE
)
...
...
@@ -753,8 +749,8 @@ void WINAPI get_native_system_info (
lpSystemInfo
->
dwNumberOfProcessors
=
-
1
;
}
BOOL
WINAPI
get_system_times
(
LPFILETIME
lpIdleTime
,
BOOL
WINAPI
get_system_times
(
LPFILETIME
lpIdleTime
,
LPFILETIME
lpKernelTime
,
LPFILETIME
lpUserTime
)
{
...
...
@@ -1691,7 +1687,7 @@ init_environment (char ** argv)
for
(
p
=
modname
;
*
p
;
p
++
)
if
(
*
p
==
'\\'
)
*
p
=
'/'
;
_snprintf
(
buf
,
sizeof
(
buf
)
-
1
,
"emacs_dir=%s"
,
modname
);
_snprintf
(
buf
,
sizeof
(
buf
)
-
1
,
"emacs_dir=%s"
,
modname
);
_putenv
(
strdup
(
buf
));
}
/* Handle running emacs from the build directory: src/oo-spd/i386/ */
...
...
@@ -1715,7 +1711,7 @@ init_environment (char ** argv)
for
(
p
=
modname
;
*
p
;
p
++
)
if
(
*
p
==
'\\'
)
*
p
=
'/'
;
_snprintf
(
buf
,
sizeof
(
buf
)
-
1
,
"emacs_dir=%s"
,
modname
);
_snprintf
(
buf
,
sizeof
(
buf
)
-
1
,
"emacs_dir=%s"
,
modname
);
_putenv
(
strdup
(
buf
));
}
}
...
...
@@ -1743,12 +1739,12 @@ init_environment (char ** argv)
char
buf1
[
SET_ENV_BUF_SIZE
],
buf2
[
SET_ENV_BUF_SIZE
];
if
(
dwType
==
REG_EXPAND_SZ
)
ExpandEnvironmentStrings
((
LPSTR
)
lpval
,
buf1
,
sizeof
(
buf1
));
ExpandEnvironmentStrings
((
LPSTR
)
lpval
,
buf1
,
sizeof
(
buf1
));
else
if
(
dwType
==
REG_SZ
)
strcpy
(
buf1
,
lpval
);
if
(
dwType
==
REG_EXPAND_SZ
||
dwType
==
REG_SZ
)
{
_snprintf
(
buf2
,
sizeof
(
buf2
)
-
1
,
"%s=%s"
,
env_vars
[
i
].
name
,
_snprintf
(
buf2
,
sizeof
(
buf2
)
-
1
,
"%s=%s"
,
env_vars
[
i
].
name
,
buf1
);
_putenv
(
strdup
(
buf2
));
}
...
...
@@ -2091,7 +2087,7 @@ GetCachedVolumeInformation (char * root_dir)
involve network access, and so is extremely quick). */
/* Map drive letter to UNC if remote. */
if ( isalpha
(
root_dir[0]
) && !fixed[ DRIVE_INDEX
(
root_dir[0]
) ] )
if ( isalpha
(
root_dir[0]) && !fixed[ DRIVE_INDEX
(
root_dir[0]) ] )
{
char remote_name[ 256 ];
char drive[3] = { root_dir[0], ':' };
...
...
@@ -2490,7 +2486,7 @@ open_unc_volume (const char *path)
nr
.
lpComment
=
NULL
;
nr
.
lpProvider
=
NULL
;
result
=
WNetOpenEnum
(
RESOURCE_GLOBALNET
,
RESOURCETYPE_DISK
,
result
=
WNetOpenEnum
(
RESOURCE_GLOBALNET
,
RESOURCETYPE_DISK
,
RESOURCEUSAGE_CONNECTABLE
,
&
nr
,
&
henum
);
if
(
result
==
NO_ERROR
)
...
...
@@ -2667,7 +2663,7 @@ sys_creat (const char * path, int mode)
}
FILE
*
sys_fopen
(
const
char
*
path
,
const
char
*
mode
)
sys_fopen
(
const
char
*
path
,
const
char
*
mode
)
{
int
fd
;
int
oflag
;
...
...
@@ -2754,7 +2750,7 @@ sys_link (const char * old, const char * new)
data
.
wid
.
dwStreamId
=
BACKUP_LINK
;
data
.
wid
.
dwStreamAttributes
=
0
;
data
.
wid
.
Size
.
LowPart
=
wlen
*
sizeof
(
WCHAR
);
data
.
wid
.
Size
.
LowPart
=
wlen
*
sizeof
(
WCHAR
);
data
.
wid
.
Size
.
HighPart
=
0
;
data
.
wid
.
dwStreamNameSize
=
0
;
...
...
@@ -2980,7 +2976,7 @@ convert_time (FILETIME ft)
if
(
!
init
)
{
initialize_utc_base
();
initialize_utc_base
();
init
=
1
;
}
...
...
@@ -3167,7 +3163,7 @@ get_name_and_id (PSECURITY_DESCRIPTOR psd, const char *fname,
char
name
[
UNLEN
+
1
];
DWORD
name_len
=
sizeof
(
name
);
char
domain
[
1024
];
DWORD
domain_len
=
sizeof
(
domain
);
DWORD
domain_len
=
sizeof
(
domain
);
char
*
mp
=
NULL
;
int
use_dflt
=
0
;
int
result
;
...
...
@@ -3213,8 +3209,7 @@ get_name_and_id (PSECURITY_DESCRIPTOR psd, const char *fname,
}
static
void
get_file_owner_and_group
(
PSECURITY_DESCRIPTOR
psd
,
get_file_owner_and_group
(
PSECURITY_DESCRIPTOR
psd
,
const
char
*
fname
,
struct
stat
*
st
)
{
...
...
@@ -3642,9 +3637,8 @@ utime (const char *name, struct utimbuf *times)
/* Helper wrapper functions. */
HANDLE
WINAPI
create_toolhelp32_snapshot
(
DWORD
Flags
,
DWORD
Ignored
)
HANDLE
WINAPI
create_toolhelp32_snapshot
(
DWORD
Flags
,
DWORD
Ignored
)
{
static
CreateToolhelp32Snapshot_Proc
s_pfn_Create_Toolhelp32_Snapshot
=
NULL
;
...
...
@@ -3662,9 +3656,8 @@ HANDLE WINAPI create_toolhelp32_snapshot(
return
(
s_pfn_Create_Toolhelp32_Snapshot
(
Flags
,
Ignored
));
}
BOOL
WINAPI
process32_first
(
HANDLE
hSnapshot
,
LPPROCESSENTRY32
lppe
)
BOOL
WINAPI
process32_first
(
HANDLE
hSnapshot
,
LPPROCESSENTRY32
lppe
)
{
static
Process32First_Proc
s_pfn_Process32_First
=
NULL
;
...
...
@@ -3682,9 +3675,8 @@ BOOL WINAPI process32_first(
return
(
s_pfn_Process32_First
(
hSnapshot
,
lppe
));
}
BOOL
WINAPI
process32_next
(
HANDLE
hSnapshot
,
LPPROCESSENTRY32
lppe
)
BOOL
WINAPI
process32_next
(
HANDLE
hSnapshot
,
LPPROCESSENTRY32
lppe
)
{
static
Process32Next_Proc
s_pfn_Process32_Next
=
NULL
;
...
...
@@ -3702,8 +3694,8 @@ BOOL WINAPI process32_next(
return
(
s_pfn_Process32_Next
(
hSnapshot
,
lppe
));
}
BOOL
WINAPI
open_thread_token
(
HANDLE
ThreadHandle
,
BOOL
WINAPI
open_thread_token
(
HANDLE
ThreadHandle
,
DWORD
DesiredAccess
,
BOOL
OpenAsSelf
,
PHANDLE
TokenHandle
)
...
...
@@ -3736,8 +3728,8 @@ BOOL WINAPI open_thread_token (
);
}
BOOL
WINAPI
impersonate_self
(
SECURITY_IMPERSONATION_LEVEL
ImpersonationLevel
)
BOOL
WINAPI
impersonate_self
(
SECURITY_IMPERSONATION_LEVEL
ImpersonationLevel
)
{
static
ImpersonateSelf_Proc
s_pfn_Impersonate_Self
=
NULL
;
HMODULE
hm_advapi32
=
NULL
;
...
...
@@ -3759,7 +3751,8 @@ BOOL WINAPI impersonate_self (
return
s_pfn_Impersonate_Self
(
ImpersonationLevel
);
}
BOOL
WINAPI
revert_to_self
(
void
)
BOOL
WINAPI
revert_to_self
(
void
)
{
static
RevertToSelf_Proc
s_pfn_Revert_To_Self
=
NULL
;
HMODULE
hm_advapi32
=
NULL
;
...
...
@@ -3781,8 +3774,8 @@ BOOL WINAPI revert_to_self (void)
return
s_pfn_Revert_To_Self
();
}
BOOL
WINAPI
get_process_memory_info
(
HANDLE
h_proc
,
BOOL
WINAPI
get_process_memory_info
(
HANDLE
h_proc
,
PPROCESS_MEMORY_COUNTERS
mem_counters
,
DWORD
bufsize
)
{
...
...
@@ -3807,10 +3800,8 @@ BOOL WINAPI get_process_memory_info (
return
s_pfn_Get_Process_Memory_Info
(
h_proc
,
mem_counters
,
bufsize
);
}
BOOL
WINAPI
get_process_working_set_size
(
HANDLE
h_proc
,
DWORD
*
minrss
,
DWORD
*
maxrss
)
BOOL
WINAPI
get_process_working_set_size
(
HANDLE
h_proc
,
DWORD
*
minrss
,
DWORD
*
maxrss
)
{
static
GetProcessWorkingSetSize_Proc
s_pfn_Get_Process_Working_Set_Size
=
NULL
;
...
...
@@ -3833,8 +3824,8 @@ BOOL WINAPI get_process_working_set_size (
return
s_pfn_Get_Process_Working_Set_Size
(
h_proc
,
minrss
,
maxrss
);
}
BOOL
WINAPI
global_memory_status
(
MEMORYSTATUS
*
buf
)
BOOL
WINAPI
global_memory_status
(
MEMORYSTATUS
*
buf
)
{
static
GlobalMemoryStatus_Proc
s_pfn_Global_Memory_Status
=
NULL
;
...
...
@@ -3856,8 +3847,8 @@ BOOL WINAPI global_memory_status (
return
s_pfn_Global_Memory_Status
(
buf
);
}
BOOL
WINAPI
global_memory_status_ex
(
MEMORY_STATUS_EX
*
buf
)
BOOL
WINAPI
global_memory_status_ex
(
MEMORY_STATUS_EX
*
buf
)
{
static
GlobalMemoryStatusEx_Proc
s_pfn_Global_Memory_Status_Ex
=
NULL
;
...
...
@@ -3992,7 +3983,7 @@ process_times (h_proc, ctime, etime, stime, utime, ttime, pcpu)
if
(
!
h_proc
||
!
get_process_times_fn
||
!
(
*
get_process_times_fn
)(
h_proc
,
&
ft_creation
,
&
ft_exit
,
||
!
(
*
get_process_times_fn
)
(
h_proc
,
&
ft_creation
,
&
ft_exit
,
&
ft_kernel
,
&
ft_user
))
return
0
;
...
...
@@ -4435,34 +4426,34 @@ init_winsock (int load_now)
if ((pfn_##fn = (void *) GetProcAddress (winsock_lib, #fn)) == NULL) \
goto fail;
LOAD_PROC
(
WSAStartup
);
LOAD_PROC
(
WSASetLastError
);
LOAD_PROC
(
WSAGetLastError
);
LOAD_PROC
(
WSAEventSelect
);
LOAD_PROC
(
WSACreateEvent
);
LOAD_PROC
(
WSACloseEvent
);
LOAD_PROC
(
socket
);
LOAD_PROC
(
bind
);
LOAD_PROC
(
connect
);
LOAD_PROC
(
ioctlsocket
);
LOAD_PROC
(
recv
);
LOAD_PROC
(
send
);
LOAD_PROC
(
closesocket
);
LOAD_PROC
(
shutdown
);
LOAD_PROC
(
htons
);
LOAD_PROC
(
ntohs
);
LOAD_PROC
(
inet_addr
);
LOAD_PROC
(
gethostname
);
LOAD_PROC
(
gethostbyname
);
LOAD_PROC
(
getservbyname
);
LOAD_PROC
(
getpeername
);
LOAD_PROC
(
WSACleanup
);
LOAD_PROC
(
setsockopt
);
LOAD_PROC
(
listen
);
LOAD_PROC
(
getsockname
);
LOAD_PROC
(
accept
);
LOAD_PROC
(
recvfrom
);
LOAD_PROC
(
sendto
);
LOAD_PROC
(
WSAStartup
);
LOAD_PROC
(
WSASetLastError
);
LOAD_PROC
(
WSAGetLastError
);
LOAD_PROC
(
WSAEventSelect
);
LOAD_PROC
(
WSACreateEvent
);
LOAD_PROC
(
WSACloseEvent
);
LOAD_PROC
(
socket
);
LOAD_PROC
(
bind
);
LOAD_PROC
(
connect
);
LOAD_PROC
(
ioctlsocket
);
LOAD_PROC
(
recv
);
LOAD_PROC
(
send
);
LOAD_PROC
(
closesocket
);
LOAD_PROC
(
shutdown
);
LOAD_PROC
(
htons
);
LOAD_PROC
(
ntohs
);
LOAD_PROC
(
inet_addr
);
LOAD_PROC
(
gethostname
);
LOAD_PROC
(
gethostbyname
);
LOAD_PROC
(
getservbyname
);
LOAD_PROC
(
getpeername
);
LOAD_PROC
(
WSACleanup
);
LOAD_PROC
(
setsockopt
);
LOAD_PROC
(
listen
);
LOAD_PROC
(
getsockname
);
LOAD_PROC
(
accept
);
LOAD_PROC
(
recvfrom
);
LOAD_PROC
(
sendto
);
#undef LOAD_PROC
/* specify version 1.1 of winsock */
...
...
@@ -4607,7 +4598,7 @@ struct {
};
char
*
sys_strerror
(
int
error_no
)
sys_strerror
(
int
error_no
)
{
int
i
;
static
char
unknown_msg
[
40
];
...
...
@@ -4619,7 +4610,7 @@ sys_strerror(int error_no)
if
(
_wsa_errlist
[
i
].
errnum
==
error_no
)
return
_wsa_errlist
[
i
].
msg
;
sprintf
(
unknown_msg
,
"Unidentified error: %d"
,
error_no
);
sprintf
(
unknown_msg
,
"Unidentified error: %d"
,
error_no
);
return
unknown_msg
;
}
...
...
@@ -4638,7 +4629,7 @@ sys_strerror(int error_no)
int
socket_to_fd
(
SOCKET
s
);
int
sys_socket
(
int
af
,
int
type
,
int
protocol
)
sys_socket
(
int
af
,
int
type
,
int
protocol
)
{
SOCKET
s
;
...
...
@@ -4841,7 +4832,7 @@ sys_gethostname (char * name, int namelen)
}
struct
hostent
*
sys_gethostbyname
(
const
char
*
name
)
sys_gethostbyname
(
const
char
*
name
)
{
struct
hostent
*
host
;
...
...
@@ -4859,7 +4850,7 @@ sys_gethostbyname(const char * name)
}
struct
servent
*
sys_getservbyname
(
const
char
*
name
,
const
char
*
proto
)
sys_getservbyname
(
const
char
*
name
,
const
char
*
proto
)
{
struct
servent
*
serv
;
...
...
@@ -5075,7 +5066,7 @@ fcntl (int s, int cmd, int options)
unsigned
long
nblock
=
1
;
int
rc
=
pfn_ioctlsocket
(
SOCK_HANDLE
(
s
),
FIONBIO
,
&
nblock
);
if
(
rc
==
SOCKET_ERROR
)
set_errno
();
set_errno
();
/* Keep track of the fact that we set this to non-blocking. */
fd_info
[
s
].
flags
|=
FILE_NDELAY
;
return
rc
;
...
...
@@ -5512,7 +5503,7 @@ sys_read (int fd, char * buffer, unsigned int count)
int
res
=
pfn_recv
(
SOCK_HANDLE
(
fd
),
buffer
,
count
,
0
);
if
(
res
==
SOCKET_ERROR
)
{
DebPrint
((
"sys_read.recv failed with error %d on socket %ld
\n
"
,
DebPrint
((
"sys_read.recv failed with error %d on socket %ld
\n
"
,
pfn_WSAGetLastError
(),
SOCK_HANDLE
(
fd
)));
set_errno
();
return
-
1
;
...
...
@@ -5669,7 +5660,7 @@ sys_write (int fd, const void * buffer, unsigned int count)
if
(
nchars
==
SOCKET_ERROR
)
{
DebPrint
((
"sys_write.send failed with error %d on socket %ld
\n
"
,
DebPrint
((
"sys_write.send failed with error %d on socket %ld
\n
"
,
pfn_WSAGetLastError
(),
SOCK_HANDLE
(
fd
)));
set_errno
();
}
...
...
@@ -5857,7 +5848,8 @@ init_ntproc ()
shutdown_handler ensures that buffers' autosave files are
up to date when the user logs off, or the system shuts down.
*/
BOOL
WINAPI
shutdown_handler
(
DWORD
type
)
BOOL
WINAPI
shutdown_handler
(
DWORD
type
)
{
/* Ctrl-C and Ctrl-Break are already suppressed, so don't handle them. */
if
(
type
==
CTRL_CLOSE_EVENT
/* User closes console window. */
...
...
@@ -5916,14 +5908,15 @@ globals_of_w32 ()
console apps. This actually applies to Emacs in both console and
GUI modes, since we had to fool windows into thinking emacs is a
console application to get console mode to work. */
SetConsoleCtrlHandler
(
shutdown_handler
,
TRUE
);
SetConsoleCtrlHandler
(
shutdown_handler
,
TRUE
);
/* "None" is the default group name on standalone workstations. */
strcpy
(
dflt_group_name
,
"None"
);
}
/* For make-serial-process */
int
serial_open
(
char
*
port
)
int
serial_open
(
char
*
port
)
{
HANDLE
hnd
;
child_process
*
cp
;
...
...
@@ -5962,8 +5955,7 @@ int serial_open (char *port)
/* For serial-process-configure */
void
serial_configure
(
struct
Lisp_Process
*
p
,
Lisp_Object
contact
)
serial_configure
(
struct
Lisp_Process
*
p
,
Lisp_Object
contact
)
{
Lisp_Object
childp2
=
Qnil
;
Lisp_Object
tem
=
Qnil
;
...
...
src/w32console.c
View file @
9d4f32e8
...
...
@@ -618,8 +618,8 @@ initialize_w32_display (struct terminal *term)
/* Respect setting of LINES and COLUMNS environment variables. */
{
char
*
lines
=
getenv
(
"LINES"
);
char
*
columns
=
getenv
(
"COLUMNS"
);
char
*
lines
=
getenv
(
"LINES"
);
char
*
columns
=
getenv
(
"COLUMNS"
);
if
(
lines
!=
NULL
&&
columns
!=
NULL
)
{
...
...
src/w32fns.c
View file @
9d4f32e8
...
...
@@ -245,7 +245,7 @@ struct MONITOR_INFO
};
/* Reportedly, VS 6 does not have this in its headers. */
#if defined(_MSC_VER) && _MSC_VER < 1300
#if defined
(_MSC_VER) && _MSC_VER < 1300
DECLARE_HANDLE(HMONITOR);
#endif
...
...
@@ -1941,7 +1941,6 @@ x_set_title (f, name, old_name)
}
}
void x_set_scroll_bar_default_width (f)
struct frame *f;
{
...
...
@@ -3169,7 +3168,7 @@ w32_wnd_proc (hwnd, msg, wParam, lParam)
wmsg.dwModifiers = w32_get_key_modifiers (wParam, lParam);
/* Get buffer size. */
size = get_composition_string_fn (context, GCS_RESULTSTR, buffer, 0);
buffer = alloca(size);
buffer = alloca
(size);
size = get_composition_string_fn (context, GCS_RESULTSTR,
buffer, size);
release_ime_context_fn (hwnd, context);
...
...
@@ -4007,7 +4006,6 @@ w32_wnd_proc (hwnd, msg, wParam, lParam)
return DefWindowProc (hwnd, msg, wParam, lParam);
}
/* The most common default return code for handled messages is 0. */
return 0;
}
...
...
@@ -4460,7 +4458,6 @@ This function is an internal primitive--use `make-frame' instead. */)
x_default_parameter (f, parameters, Qright_fringe, Qnil,
"rightFringe", "RightFringe", RES_TYPE_NUMBER);
/* Init faces before x_default_parameter is called for scroll-bar
parameters because that function calls x_set_scroll_bar_width,
which calls change_frame_size, which calls Fset_window_buffer,
...
...
src/w32font.c
View file @
9d4f32e8
...
...
@@ -568,7 +568,7 @@ w32font_draw (s, from, to, x, y, with_background)
/* Save clip region for later restoration. */
orig_clip
=
CreateRectRgn
(
0
,
0
,
0
,
0
);
if
(
!
GetClipRgn
(
s
->
hdc
,
orig_clip
))
if
(
!
GetClipRgn
(
s
->
hdc
,
orig_clip
))
{
DeleteObject
(
orig_clip
);
orig_clip
=
NULL
;
...
...
@@ -1833,7 +1833,7 @@ w32_registry (w32_charset, font_type)
return
font_type
==
TRUETYPE_FONTTYPE
?
Qiso10646_1
:
Qunknown
;
charset
=
w32_to_x_charset
(
w32_charset
,
NULL
);
return
font_intern_prop
(
charset
,
strlen
(
charset
),
1
);
return
font_intern_prop
(
charset
,
strlen
(
charset
),
1
);
}
static
int
...
...
@@ -1966,7 +1966,6 @@ fill_in_logfont (f, logfont, font_spec)
logfont
->
lfPitchAndFamily
=
family
|
DEFAULT_PITCH
;
}
/* Set pitch based on the spacing property. */
tmp
=
AREF
(
font_spec
,
FONT_SPACING_INDEX
);
if
(
INTEGERP
(
tmp
))
...
...
@@ -2317,7 +2316,8 @@ w32font_full_name (font, font_obj, pixel_size, name, nbytes)
is written. If the buffer is not large enough to contain the name,
the function returns -1, otherwise it returns the number of bytes
written to FCNAME. */
static
int
logfont_to_fcname
(
font
,
pointsize
,
fcname
,
size
)
static
int
logfont_to_fcname
(
font
,
pointsize
,
fcname
,
size
)
LOGFONT
*
font
;
int
pointsize
;
char
*
fcname
;
...
...
src/w32heap.c
View file @
9d4f32e8
...
...
@@ -279,7 +279,7 @@ round_heap (unsigned long align)
sbrk
(
need_to_alloc
);