math: fix const warnings

pull/2016/head
Alexander Medvednikov 2019-09-16 21:26:05 +03:00
parent ff009f1c4e
commit 19b04d5427
3 changed files with 20 additions and 20 deletions

View File

@ -414,7 +414,7 @@ fn (p mut Parser) fn_decl() {
p.genln('init_consts();')
if 'os' in p.table.imports {
if f.name == 'main' {
p.genln('os__args = os__init_os_args(argc, argv);')
p.genln('os__args = os__init_os_args(argc, (byteptr*)argv);')
}
else if f.name == 'WinMain' {
p.genln('os__args = os__parse_windows_cmd_line(pCmdLine);')

View File

@ -1045,6 +1045,6 @@ pub fn cerror(s string) {
fn vhash() string {
mut buf := [50]byte
buf[0] = 0
C.snprintf(buf, 50, '%s', C.V_COMMIT_HASH )
C.snprintf(*char(buf), 50, '%s', C.V_COMMIT_HASH )
return tos_clone(buf)
}

View File

@ -29,18 +29,18 @@ const (
)
const (
MaxI8 = (1<<7) - 1
MinI8 = -1 << 7
MaxI16 = (1<<15) - 1
MinI16 = -1 << 15
MaxI32 = (1<<31) - 1
MinI32 = -1 << 31
MaxI8 = 127
MinI8 = -128
MaxI16 = 32767
MinI16 = -32768
MaxI32 = 2147483647
MinI32 = -2147483648
// MaxI64 = ((1<<63) - 1)
// MinI64 = (-(1 << 63) )
MaxU8 = (1<<8) - 1
MaxU16 = (1<<16) - 1
MaxU32 = (1<<32) - 1
MaxU64 = (1<<64) - 1
MaxU8 = 255
MaxU16 = 65535
MaxU32 = 4294967295
MaxU64 = 18446744073709551615
)
// Returns the absolute value.