mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
all: unify const names to snake_case
This commit is contained in:
@@ -10,8 +10,7 @@ fn error_code() int {
|
||||
}
|
||||
|
||||
pub const (
|
||||
MSG_NOSIGNAL = 0x4000
|
||||
msg_nosignal = 0x4000
|
||||
)
|
||||
|
||||
#flag solaris -lsocket
|
||||
|
||||
|
||||
@@ -17,12 +17,12 @@ mut:
|
||||
|
||||
|
||||
const (
|
||||
WSA_V22 = 0x202 // C.MAKEWORD(2, 2)
|
||||
wsa_v22 = 0x202 // C.MAKEWORD(2, 2)
|
||||
)
|
||||
|
||||
fn init() {
|
||||
mut wsadata := C.WSAData{}
|
||||
res := C.WSAStartup(WSA_V22, &wsadata)
|
||||
res := C.WSAStartup(wsa_v22, &wsadata)
|
||||
if res != 0 {
|
||||
panic('socket: WSAStartup failed')
|
||||
}
|
||||
@@ -33,5 +33,5 @@ fn error_code() int {
|
||||
}
|
||||
|
||||
pub const (
|
||||
MSG_NOSIGNAL = 0
|
||||
msg_nosignal = 0
|
||||
)
|
||||
|
||||
@@ -227,7 +227,7 @@ pub fn (s Socket) send(buf byteptr, len int) ?int {
|
||||
mut dptr := buf
|
||||
mut dlen := len
|
||||
for {
|
||||
sbytes := C.send(s.sockfd, dptr, dlen, MSG_NOSIGNAL)
|
||||
sbytes := C.send(s.sockfd, dptr, dlen, msg_nosignal)
|
||||
if sbytes < 0 {
|
||||
return error('net.send: failed with $sbytes')
|
||||
}
|
||||
@@ -300,7 +300,7 @@ pub const (
|
||||
// write - write a string with CRLF after it over the socket s
|
||||
pub fn (s Socket) write(str string) ?int {
|
||||
line := '$str$CRLF'
|
||||
res := C.send(s.sockfd, line.str, line.len, MSG_NOSIGNAL)
|
||||
res := C.send(s.sockfd, line.str, line.len, msg_nosignal)
|
||||
if res < 0 {
|
||||
return error('net.write: failed with $res')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user