diff options
Diffstat (limited to 'tests/manyloc')
31 files changed, 188 insertions, 148 deletions
diff --git a/tests/manyloc/argument_parser/argument_parser.nim b/tests/manyloc/argument_parser/argument_parser.nim index 9a37ef8c9..0ad57167b 100644 --- a/tests/manyloc/argument_parser/argument_parser.nim +++ b/tests/manyloc/argument_parser/argument_parser.nim @@ -102,7 +102,7 @@ type # - Tparam_kind procs -proc `$`*(value: Tparam_kind): string {.procvar.} = +proc `$`*(value: Tparam_kind): string = ## Stringifies the type, used to generate help texts. case value: of PK_EMPTY: result = "" @@ -137,7 +137,7 @@ proc new_parameter_specification*(consumes = PK_EMPTY, # - Tparsed_parameter procs -proc `$`*(data: Tparsed_parameter): string {.procvar.} = +proc `$`*(data: Tparsed_parameter): string = ## Stringifies the value, mostly for debug purposes. ## ## The proc will display the value followed by non string type in brackets. @@ -168,14 +168,14 @@ template new_parsed_parameter*(tkind: Tparam_kind, expr): Tparsed_parameter = ## initialised with. The template figures out at compile time what field to ## assign the variable to, and thus you reduce code clutter and may use this ## to initialise single assignments variables in `let` blocks. Example: - ## - ## .. code-block:: nim + ## ```nim ## let ## parsed_param1 = new_parsed_parameter(PK_FLOAT, 3.41) ## parsed_param2 = new_parsed_parameter(PK_BIGGEST_INT, 2358123 * 23123) ## # The following line doesn't compile due to ## # type mismatch: got <string> but expected 'int' ## #parsed_param3 = new_parsed_parameter(PK_INT, "231") + ## ``` var result {.gensym.}: Tparsed_parameter result.kind = tkind when tkind == PK_EMPTY: discard @@ -225,7 +225,7 @@ template raise_or_quit(exception, message: untyped) = template run_custom_proc(parsed_parameter: Tparsed_parameter, custom_validator: Tparameter_callback, - parameter: TaintedString) = + parameter: string) = ## Runs the custom validator if it is not nil. ## ## Pass in the string of the parameter triggering the call. If the @@ -251,8 +251,8 @@ proc parse_parameter(quit_on_failure: bool, param, value: string, case param_kind: of PK_INT: try: result.int_val = value.parseInt - except OverflowError: - raise_or_quit(OverflowError, ("parameter $1 requires an " & + except OverflowDefect: + raise_or_quit(OverflowDefect, ("parameter $1 requires an " & "integer, but $2 is too large to fit into one") % [param, escape(value)]) except ValueError: @@ -301,8 +301,7 @@ template build_specification_lookup(): OrderedTable[string, ptr Tparameter_specification] = ## Returns the table used to keep pointers to all of the specifications. var result {.gensym.}: OrderedTable[string, ptr Tparameter_specification] - result = initOrderedTable[string, ptr Tparameter_specification]( - tables.rightSize(expected.len)) + result = initOrderedTable[string, ptr Tparameter_specification](expected.len) for i in 0..expected.len-1: for param_to_detect in expected[i].names: if result.hasKey(param_to_detect): @@ -319,7 +318,7 @@ proc echo_help*(expected: seq[Tparameter_specification] = @[], proc parse*(expected: seq[Tparameter_specification] = @[], - type_of_positional_parameters = PK_STRING, args: seq[TaintedString] = @[], + type_of_positional_parameters = PK_STRING, args: seq[string] = @[], bad_prefixes = @["-", "--"], end_of_options = "--", quit_on_failure = true): Tcommandline_results = ## Parses parameters and returns results. @@ -447,7 +446,7 @@ proc build_help*(expected: seq[Tparameter_specification] = @[], # First generate the joined version of input parameters in a list. var - seen = initSet[string]() + seen = initHashSet[string]() prefixes: seq[string] = @[] helps: seq[string] = @[] for key in keys: @@ -471,7 +470,7 @@ proc build_help*(expected: seq[Tparameter_specification] = @[], let width = prefixes.map(proc (x: string): int = 3 + len(x)).max for line in zip(prefixes, helps): - result.add(line.a & spaces(width - line.a.len) & line.b) + result.add(line[0] & spaces(width - line[0].len) & line[1]) proc echo_help*(expected: seq[Tparameter_specification] = @[], diff --git a/tests/manyloc/keineschweine/dependencies/chipmunk/chipmunk.nim b/tests/manyloc/keineschweine/dependencies/chipmunk/chipmunk.nim index ac425c7a0..6eb1b3844 100644 --- a/tests/manyloc/keineschweine/dependencies/chipmunk/chipmunk.nim +++ b/tests/manyloc/keineschweine/dependencies/chipmunk/chipmunk.nim @@ -106,7 +106,7 @@ type #/ Collision begin event function callback type. #/ Returning false from a begin callback causes the collision to be ignored until - #/ the the separate callback is called when the objects stop colliding. + #/ the separate callback is called when the objects stop colliding. TCollisionBeginFunc* = proc (arb: PArbiter; space: PSpace; data: pointer): bool{. cdecl.} #/ Collision pre-solve event function callback type. @@ -455,7 +455,7 @@ proc removeCollisionHandler*(space: PSpace; a: TCollisionType; #/ If the shape is attached to a static body, it will be added as a static shape. proc addShape*(space: PSpace; shape: PShape): PShape{. cdecl, importc: "cpSpaceAddShape", dynlib: Lib.} -#/ Explicity add a shape as a static shape to the simulation. +#/ Explicitly add a shape as a static shape to the simulation. proc addStaticShape*(space: PSpace; shape: PShape): PShape{. cdecl, importc: "cpSpaceAddStaticShape", dynlib: Lib.} #/ Add a rigid body to the simulation. @@ -1028,12 +1028,12 @@ proc getCircleRadius*(shape: PShape): CpFloat {. proc allocPolyShape*(): PPolyShape {. cdecl, importc: "cpPolyShapeAlloc", dynlib: Lib.} #/ Initialize a polygon shape. -#/ A convex hull will be created from the vertexes. +#/ A convex hull will be created from the vertices. proc init*(poly: PPolyShape; body: PBody, numVerts: cint; verts: ptr TVector; offset: TVector): PPolyShape {. cdecl, importc: "cpPolyShapeInit", dynlib: Lib.} #/ Allocate and initialize a polygon shape. -#/ A convex hull will be created from the vertexes. +#/ A convex hull will be created from the vertices. proc newPolyShape*(body: PBody; numVerts: cint; verts: ptr TVector; offset: TVector): PShape {. cdecl, importc: "cpPolyShapeNew", dynlib: Lib.} @@ -1050,7 +1050,7 @@ proc newBoxShape*(body: PBody; width, height: CpFloat): PShape {. proc newBoxShape*(body: PBody; box: TBB): PShape {. cdecl, importc: "cpBoxShapeNew2", dynlib: Lib.} -#/ Check that a set of vertexes is convex and has a clockwise winding. +#/ Check that a set of vertices is convex and has a clockwise winding. #/ NOTE: Due to floating point precision issues, hulls created with cpQuickHull() are not guaranteed to validate! proc validatePoly*(verts: ptr TVector; numVerts: cint): bool {. cdecl, importc: "cpPolyValidate", dynlib: Lib.} diff --git a/tests/manyloc/keineschweine/dependencies/enet/enet.nim b/tests/manyloc/keineschweine/dependencies/enet/enet.nim index 07079f2ea..5dee6ae9c 100644 --- a/tests/manyloc/keineschweine/dependencies/enet/enet.nim +++ b/tests/manyloc/keineschweine/dependencies/enet/enet.nim @@ -79,10 +79,10 @@ type PPacket* = ptr TPacket TPacket*{.pure, final.} = object - referenceCount: csize + referenceCount: csize_t flags*: cint data*: cstring#ptr cuchar - dataLength*: csize + dataLength*: csize_t freeCallback*: TPacketFreeCallback PAcknowledgement* = ptr TAcknowledgement @@ -265,7 +265,7 @@ const ENET_PEER_RELIABLE_WINDOW_SIZE = 0x1000 ENET_PEER_FREE_RELIABLE_WINDOWS = 8 -when defined(Linux) or true: +when defined(linux) or true: import posix const ENET_SOCKET_NULL*: cint = -1 @@ -274,7 +274,7 @@ when defined(Linux) or true: PEnetBuffer* = ptr object TENetBuffer*{.pure, final.} = object data*: pointer - dataLength*: csize + dataLength*: csize_t TENetSocketSet* = Tfd_set ## see if these are different on win32, if not then get rid of these template ENET_HOST_TO_NET_16*(value: untyped): untyped = @@ -295,7 +295,7 @@ when defined(Linux) or true: template ENET_SOCKETSET_CHECK*(sockset, socket: untyped): untyped = FD_ISSET(socket, addr((sockset))) -when defined(Windows): +when defined(windows): ## put the content of win32.h in here @@ -324,7 +324,7 @@ type data*: pointer state*: TPeerState channels*: PChannel - channelCount*: csize + channelCount*: csize_t incomingBandwidth*: cuint outgoingBandwidth*: cuint incomingBandwidthThrottleEpoch*: cuint @@ -374,13 +374,13 @@ type TCompressor*{.pure, final.} = object context*: pointer compress*: proc (context: pointer; inBuffers: ptr TEnetBuffer; - inBufferCount: csize; inLimit: csize; - outData: ptr cuchar; outLimit: csize): csize{.cdecl.} - decompress*: proc (context: pointer; inData: ptr cuchar; inLimit: csize; - outData: ptr cuchar; outLimit: csize): csize{.cdecl.} + inBufferCount: csize_t; inLimit: csize_t; + outData: ptr cuchar; outLimit: csize_t): csize_t{.cdecl.} + decompress*: proc (context: pointer; inData: ptr cuchar; inLimit: csize_t; + outData: ptr cuchar; outLimit: csize_t): csize_t{.cdecl.} destroy*: proc (context: pointer){.cdecl.} - TChecksumCallback* = proc (buffers: ptr TEnetBuffer; bufferCount: csize): cuint{. + TChecksumCallback* = proc (buffers: ptr TEnetBuffer; bufferCount: csize_t): cuint{. cdecl.} PHost* = ptr THost @@ -394,25 +394,25 @@ type randomSeed*: cuint recalculateBandwidthLimits*: cint peers*: ptr TPeer - peerCount*: csize - channelLimit*: csize + peerCount*: csize_t + channelLimit*: csize_t serviceTime*: cuint dispatchQueue*: TEnetList continueSending*: cint - packetSize*: csize + packetSize*: csize_t headerFlags*: cushort commands*: array[0..ENET_PROTOCOL_MAXIMUM_PACKET_COMMANDS - 1, TEnetProtocol] - commandCount*: csize + commandCount*: csize_t buffers*: array[0..ENET_BUFFER_MAXIMUM - 1, TEnetBuffer] - bufferCount*: csize + bufferCount*: csize_t checksum*: TChecksumCallback compressor*: TCompressor packetData*: array[0..ENET_PROTOCOL_MAXIMUM_MTU - 1, array[0..2 - 1, cuchar]] receivedAddress*: TAddress receivedData*: ptr cuchar - receivedDataLength*: csize + receivedDataLength*: csize_t totalSentData*: cuint totalSentPackets*: cuint totalReceivedData*: cuint @@ -430,12 +430,12 @@ type packet*: ptr TPacket TENetCallbacks*{.pure, final.} = object - malloc*: proc (size: csize): pointer{.cdecl.} + malloc*: proc (size: csize_t): pointer{.cdecl.} free*: proc (memory: pointer){.cdecl.} no_memory*: proc (){.cdecl.} {.push callConv:cdecl.} -proc enet_malloc*(a2: csize): pointer{. +proc enet_malloc*(a2: csize_t): pointer{. importc: "enet_malloc", dynlib: Lib.} proc enet_free*(a2: pointer){. importc: "enet_free", dynlib: Lib.} @@ -468,15 +468,15 @@ proc connect*(socket: TEnetSocket; address: var TAddress): cint{. importc: "enet_socket_connect", dynlib: Lib.} proc connect*(socket: TEnetSocket; address: ptr TAddress): cint{. importc: "enet_socket_connect", dynlib: Lib.} -proc send*(socket: TEnetSocket; address: var TAddress; buffer: ptr TEnetBuffer; size: csize): cint{. +proc send*(socket: TEnetSocket; address: var TAddress; buffer: ptr TEnetBuffer; size: csize_t): cint{. importc: "enet_socket_send", dynlib: Lib.} -proc send*(socket: TEnetSocket; address: ptr TAddress; buffer: ptr TEnetBuffer; size: csize): cint{. +proc send*(socket: TEnetSocket; address: ptr TAddress; buffer: ptr TEnetBuffer; size: csize_t): cint{. importc: "enet_socket_send", dynlib: Lib.} proc receive*(socket: TEnetSocket; address: var TAddress; - buffer: ptr TEnetBuffer; size: csize): cint{. + buffer: ptr TEnetBuffer; size: csize_t): cint{. importc: "enet_socket_receive", dynlib: Lib.} proc receive*(socket: TEnetSocket; address: ptr TAddress; - buffer: ptr TEnetBuffer; size: csize): cint{. + buffer: ptr TEnetBuffer; size: csize_t): cint{. importc: "enet_socket_receive", dynlib: Lib.} proc wait*(socket: TEnetSocket; a3: ptr cuint; a4: cuint): cint{. importc: "enet_socket_wait", dynlib: Lib.} @@ -492,42 +492,42 @@ proc setHost*(address: PAddress; hostName: cstring): cint{. importc: "enet_address_set_host", dynlib: Lib.} proc setHost*(address: var TAddress; hostName: cstring): cint{. importc: "enet_address_set_host", dynlib: Lib.} -proc getHostIP*(address: var TAddress; hostName: cstring; nameLength: csize): cint{. +proc getHostIP*(address: var TAddress; hostName: cstring; nameLength: csize_t): cint{. importc: "enet_address_get_host_ip", dynlib: Lib.} -proc getHost*(address: var TAddress; hostName: cstring; nameLength: csize): cint{. +proc getHost*(address: var TAddress; hostName: cstring; nameLength: csize_t): cint{. importc: "enet_address_get_host", dynlib: Lib.} ## Call the above two funcs but trim the result string -proc getHostIP*(address: var TAddress; hostName: var string; nameLength: csize): cint{.inline.} = +proc getHostIP*(address: var TAddress; hostName: var string; nameLength: csize_t): cint{.inline.} = hostName.setLen nameLength result = getHostIP(address, cstring(hostName), nameLength) if result == 0: hostName.setLen(len(cstring(hostName))) -proc getHost*(address: var TAddress; hostName: var string; nameLength: csize): cint{.inline.} = +proc getHost*(address: var TAddress; hostName: var string; nameLength: csize_t): cint{.inline.} = hostName.setLen nameLength result = getHost(address, cstring(hostName), nameLength) if result == 0: hostName.setLen(len(cstring(hostName))) -proc createPacket*(data: pointer; len: csize; flag: TPacketFlag): PPacket{. +proc createPacket*(data: pointer; len: csize_t; flag: TPacketFlag): PPacket{. importc: "enet_packet_create", dynlib: Lib.} proc destroy*(packet: PPacket){. importc: "enet_packet_destroy", dynlib: Lib.} -proc resize*(packet: PPacket; dataLength: csize): cint{. +proc resize*(packet: PPacket; dataLength: csize_t): cint{. importc: "enet_packet_resize", dynlib: Lib.} -proc crc32*(buffers: ptr TEnetBuffer; bufferCount: csize): cuint{. +proc crc32*(buffers: ptr TEnetBuffer; bufferCount: csize_t): cuint{. importc: "enet_crc32", dynlib: Lib.} -proc createHost*(address: ptr TAddress; maxConnections, maxChannels: csize; downSpeed, upSpeed: cuint): PHost{. +proc createHost*(address: ptr TAddress; maxConnections, maxChannels: csize_t; downSpeed, upSpeed: cuint): PHost{. importc: "enet_host_create", dynlib: Lib.} -proc createHost*(address: var TAddress; maxConnections, maxChannels: csize; downSpeed, upSpeed: cuint): PHost{. +proc createHost*(address: var TAddress; maxConnections, maxChannels: csize_t; downSpeed, upSpeed: cuint): PHost{. importc: "enet_host_create", dynlib: Lib.} proc destroy*(host: PHost){. importc: "enet_host_destroy", dynlib: Lib.} -proc connect*(host: PHost; address: ptr TAddress; channelCount: csize; data: cuint): PPeer{. +proc connect*(host: PHost; address: ptr TAddress; channelCount: csize_t; data: cuint): PPeer{. importc: "enet_host_connect", dynlib: Lib.} -proc connect*(host: PHost; address: var TAddress; channelCount: csize; data: cuint): PPeer{. +proc connect*(host: PHost; address: var TAddress; channelCount: csize_t; data: cuint): PPeer{. importc: "enet_host_connect", dynlib: Lib.} proc checkEvents*(host: PHost; event: var TEvent): cint{. @@ -546,7 +546,7 @@ proc compress*(host: PHost; compressor: PCompressor){. importc: "enet_host_compress", dynlib: Lib.} proc compressWithRangeCoder*(host: PHost): cint{. importc: "enet_host_compress_with_range_coder", dynlib: Lib.} -proc channelLimit*(host: PHost; channelLimit: csize){. +proc channelLimit*(host: PHost; channelLimit: csize_t){. importc: "enet_host_channel_limit", dynlib: Lib.} proc bandwidthLimit*(host: PHost; incoming, outgoing: cuint){. importc: "enet_host_bandwidth_limit", dynlib: Lib.} @@ -596,12 +596,12 @@ proc createRangeCoder*(): pointer{. proc rangeCoderDestroy*(context: pointer){. importc: "enet_range_coder_destroy", dynlib: Lib.} proc rangeCoderCompress*(context: pointer; inBuffers: PEnetBuffer; inLimit, - bufferCount: csize; outData: cstring; outLimit: csize): csize{. + bufferCount: csize_t; outData: cstring; outLimit: csize_t): csize_t{. importc: "enet_range_coder_compress", dynlib: Lib.} -proc rangeCoderDecompress*(context: pointer; inData: cstring; inLimit: csize; - outData: cstring; outLimit: csize): csize{. +proc rangeCoderDecompress*(context: pointer; inData: cstring; inLimit: csize_t; + outData: cstring; outLimit: csize_t): csize_t{. importc: "enet_range_coder_decompress", dynlib: Lib.} -proc protocolCommandSize*(commandNumber: cuchar): csize{. +proc protocolCommandSize*(commandNumber: cuchar): csize_t{. importc: "enet_protocol_command_size", dynlib: Lib.} {.pop.} @@ -609,4 +609,3 @@ proc protocolCommandSize*(commandNumber: cuchar): csize{. from hashes import `!$`, `!&`, Hash, hash proc hash*(x: TAddress): Hash {.nimcall, noSideEffect.} = result = !$(hash(x.host.int32) !& hash(x.port.int16)) - diff --git a/tests/manyloc/keineschweine/dependencies/genpacket/genpacket_enet.nim b/tests/manyloc/keineschweine/dependencies/genpacket/genpacket_enet.nim index b36b49823..d91f1cb35 100644 --- a/tests/manyloc/keineschweine/dependencies/genpacket/genpacket_enet.nim +++ b/tests/manyloc/keineschweine/dependencies/genpacket/genpacket_enet.nim @@ -114,7 +114,7 @@ macro defPacket*(typeNameN: untyped, typeFields: untyped): untyped = packBody.add(newCall("pack", streamID, dotName)) readBody.add(resName := newCall("read" & $typeFields[i][1].ident, streamID)) else: - error("I dont know what to do with: " & treerepr(typeFields[i])) + error("I don't know what to do with: " & treerepr(typeFields[i])) var toStringFunc = newNimNode(nnkProcDef).und( diff --git a/tests/manyloc/keineschweine/dependencies/genpacket/streams_enh.nim b/tests/manyloc/keineschweine/dependencies/genpacket/streams_enh.nim index ad0d20f1c..a0c8a7a3c 100644 --- a/tests/manyloc/keineschweine/dependencies/genpacket/streams_enh.nim +++ b/tests/manyloc/keineschweine/dependencies/genpacket/streams_enh.nim @@ -1,7 +1,7 @@ import streams from strutils import repeat -proc readPaddedStr*(s: PStream, length: int, padChar = '\0'): TaintedString = +proc readPaddedStr*(s: PStream, length: int, padChar = '\0'): string = var lastChr = length result = s.readStr(length) while lastChr >= 0 and result[lastChr - 1] == padChar: dec(lastChr) @@ -16,7 +16,7 @@ proc writePaddedStr*(s: PStream, str: string, length: int, padChar = '\0') = else: s.write(str) -proc readLEStr*(s: PStream): TaintedString = +proc readLEStr*(s: PStream): string = var len = s.readInt16() result = s.readStr(len) diff --git a/tests/manyloc/keineschweine/dependencies/nake/nake.nim b/tests/manyloc/keineschweine/dependencies/nake/nake.nim index 83569e30e..36538097e 100644 --- a/tests/manyloc/keineschweine/dependencies/nake/nake.nim +++ b/tests/manyloc/keineschweine/dependencies/nake/nake.nim @@ -7,6 +7,10 @@ contents thereof. As said in the Olde Country, `Keepe it Gangster'.""" +#[ +xxx remove this? seems mostly duplicate of: tests/manyloc/nake/nake.nim +]# + import strutils, parseopt, tables, os type @@ -51,7 +55,7 @@ template withDir*(dir: string; body: stmt): stmt = cd(curDir) when true: - if not existsFile("nakefile.nim"): + if not fileExists("nakefile.nim"): echo "No nakefile.nim found. Current working dir is ", getCurrentDir() quit 1 var args = "" @@ -60,11 +64,12 @@ when true: args.add " " quit(shell("nim", "c", "-r", "nakefile.nim", args)) else: - addQuitProc(proc() {.noconv.} = + import std/exitprocs + addExitProc(proc() {.noconv.} = var task: string printTaskList: bool - for kind, key, val in getOpt(): + for kind, key, val in getopt(): case kind of cmdLongOption, cmdShortOption: case key.tolower diff --git a/tests/manyloc/keineschweine/enet_server/enet_client.nim b/tests/manyloc/keineschweine/enet_server/enet_client.nim index 7b8576a14..7aa7b9c2f 100644 --- a/tests/manyloc/keineschweine/enet_server/enet_client.nim +++ b/tests/manyloc/keineschweine/enet_server/enet_client.nim @@ -197,7 +197,7 @@ proc lobbyInit*() = messageArea.scrollBack -= 1 update(messageArea)) gui.newButton(text = "Flood msg area", position = vec2f(185, 30), onClick = proc(b: PButton) = - for i in 0.. <30: + for i in 0..< 30: dispMessage($i))""" dirServer = newServer() dirServer.addHandler HChat, handleChat diff --git a/tests/manyloc/keineschweine/enet_server/enet_server.nim b/tests/manyloc/keineschweine/enet_server/enet_server.nim index 336e57755..86d0ab360 100644 --- a/tests/manyloc/keineschweine/enet_server/enet_server.nim +++ b/tests/manyloc/keineschweine/enet_server/enet_server.nim @@ -113,12 +113,12 @@ when true: block: var zoneCfgFile = "./server_settings.json" - for kind, key, val in getOpt(): + for kind, key, val in getopt(): case kind of cmdShortOption, cmdLongOption: case key of "f", "file": - if existsFile(val): + if fileExists(val): zoneCfgFile = val else: echo("File does not exist: ", val) @@ -136,7 +136,7 @@ when true: address.port = port var path = getAppDir()/../"data"/zoneFile - if not existsFile(path): + if not fileExists(path): echo("Zone settings file does not exist: ../data/", zoneFile) echo(path) quit(1) diff --git a/tests/manyloc/keineschweine/enet_server/server_utils.nim b/tests/manyloc/keineschweine/enet_server/server_utils.nim index 1fb8326ed..3940dcf01 100644 --- a/tests/manyloc/keineschweine/enet_server/server_utils.nim +++ b/tests/manyloc/keineschweine/enet_server/server_utils.nim @@ -1,4 +1,6 @@ -import enet, sg_packets, estreams, md5, zlib_helpers, client_helpers, strutils, +import ../../../../dist/checksums/src/checksums/md5 + +import enet, sg_packets, estreams, zlib_helpers, client_helpers, strutils, idgen, sg_assets, tables, os type PClient* = ref object diff --git a/tests/manyloc/keineschweine/keineschweine.nim b/tests/manyloc/keineschweine/keineschweine.nim index b6fd3cc19..123a4aebb 100644 --- a/tests/manyloc/keineschweine/keineschweine.nim +++ b/tests/manyloc/keineschweine/keineschweine.nim @@ -446,7 +446,7 @@ ingameClient.registerHandler(KeyF12, down, proc() = toggleSpec()) ingameClient.registerHandler(KeyF11, down, toggleShipSelect) ingameClient.registerHandler(MouseLeft, down, handleLClick) when defined(recordMode): - if not existsDir("data/snapshots"): + if not dirExists("data/snapshots"): createDir("data/snapshots") ingameClient.registerHandler(keynum9, down, proc() = if not isRecording: startRecording() @@ -486,7 +486,7 @@ when defined(DebugKeys): activeVehicle.body.setPos mouseToSpace()) ingameClient.registerHandler(KeyY, down, proc() = const looloo = ["Asteroid1", "Asteroid2"] - addObject(looloo[random(looloo.len)])) + addObject(looloo[rand(looloo.len)])) ingameClient.registerHandler(KeyO, down, proc() = if objects.len == 0: echo "Objects is empty" @@ -691,7 +691,7 @@ when true: block: var bPlayOffline = false - for kind, key, val in getOpt(): + for kind, key, val in getopt(): case kind of cmdArgument: if key == "offline": bPlayOffline = true diff --git a/tests/manyloc/keineschweine/keineschweine.nim.cfg b/tests/manyloc/keineschweine/keineschweine.nim.cfg index f335a0e0e..a670e2b77 100644 --- a/tests/manyloc/keineschweine/keineschweine.nim.cfg +++ b/tests/manyloc/keineschweine/keineschweine.nim.cfg @@ -7,4 +7,4 @@ path = "dependencies/genpacket" path = "enet_server" debugger = off warning[SmallLshouldNotBeUsed] = off -nilseqs = on +mm = refc diff --git a/tests/manyloc/keineschweine/lib/client_helpers.nim b/tests/manyloc/keineschweine/lib/client_helpers.nim index 0ebb4ade1..b21e67cf7 100644 --- a/tests/manyloc/keineschweine/lib/client_helpers.nim +++ b/tests/manyloc/keineschweine/lib/client_helpers.nim @@ -1,6 +1,8 @@ +import ../../../../dist/checksums/src/checksums/md5 + import tables, sg_packets, enet, estreams, sg_gui, sfml, - zlib_helpers, md5, sg_assets, os + zlib_helpers, sg_assets, os type PServer* = ptr TServer TServer* = object @@ -69,7 +71,7 @@ proc updateFileProgress*() = downloadProgress.setString($currentFileTransfer.pos & '/' & $currentFileTransfer.fullLen) ## HFileTransfer -proc handleFilePartRecv*(serv: PServer; buffer: PBuffer) {.procvar.} = +proc handleFilePartRecv*(serv: PServer; buffer: PBuffer) = var f = readScFileTransfer(buffer) updateFileProgress() @@ -103,14 +105,14 @@ proc saveCurrentFile() = let path = expandPath(currentFileTransfer.assetType, currentFileTransfer.fileName) parent = parentDir(path) - if not existsDir(parent): + if not dirExists(parent): createDir(parent) echo("Created dir") writeFile path, currentFIleTransfer.data echo "Write file" ## HChallengeResult -proc handleFileChallengeResult*(serv: PServer; buffer: PBuffer) {.procvar.} = +proc handleFileChallengeResult*(serv: PServer; buffer: PBuffer) = var res = readScChallengeResult(buffer).status echo "got challnege result: ", res if res and currentFileTransfer.readyToSave: @@ -122,12 +124,12 @@ proc handleFileChallengeResult*(serv: PServer; buffer: PBuffer) {.procvar.} = echo "REsetting current file" ## HFileCHallenge -proc handleFileChallenge*(serv: PServer; buffer: PBuffer) {.procvar.} = +proc handleFileChallenge*(serv: PServer; buffer: PBuffer) = var challenge = readScFileChallenge(buffer) path = expandPath(challenge) resp: CsFileChallenge - if not existsFile(path): + if not fileExists(path): resp.needFile = true echo "Got file challenge, need file." else: diff --git a/tests/manyloc/keineschweine/lib/estreams.nim b/tests/manyloc/keineschweine/lib/estreams.nim index 99cbb63d1..c5e45e0e7 100644 --- a/tests/manyloc/keineschweine/lib/estreams.nim +++ b/tests/manyloc/keineschweine/lib/estreams.nim @@ -26,7 +26,7 @@ proc newBuffer*(pkt: PPacket): PBuffer = copyMem(addr result.data[0], pkt.data, pkt.dataLength) proc toPacket*(buffer: PBuffer; flags: TPacketFlag): PPacket = buffer.data.setLen buffer.pos - result = createPacket(cstring(buffer.data), buffer.pos, flags) + result = createPacket(cstring(buffer.data), cast[csize_t](buffer.pos), flags) proc isDirty*(buffer: PBuffer): bool {.inline.} = result = (buffer.pos != 0) @@ -78,9 +78,9 @@ proc write*(buffer: PBuffer; val: var string) = setLen buffer.data, buffer.pos + length.int copyMem(addr buffer.data[buffer.pos], addr val[0], length.int) inc buffer.pos, length.int -proc write*[T: SomeNumber|bool|char|byte](buffer: PBuffer; val: T) = +proc write*[T: SomeNumber|bool|char|byte](buffer: PBuffer; val: sink T) = var v: T - shallowCopy v, val + v = val writeBE buffer, v proc readInt8*(buffer: PBuffer): int8 = @@ -118,5 +118,3 @@ when false: echo "flushed" b.writeC([1,2,3]) echo(repr(b)) - - diff --git a/tests/manyloc/keineschweine/lib/glut.nim b/tests/manyloc/keineschweine/lib/glut.nim index 44a290728..de9a97456 100644 --- a/tests/manyloc/keineschweine/lib/glut.nim +++ b/tests/manyloc/keineschweine/lib/glut.nim @@ -93,7 +93,7 @@ const GLUT_NORMAL* = 0 GLUT_OVERLAY* = 1 -when defined(Windows): +when defined(windows): const # Stroke font constants (use these in GLUT program). GLUT_STROKE_ROMAN* = cast[Pointer](0) GLUT_STROKE_MONO_ROMAN* = cast[Pointer](1) # Bitmap font constants (use these in GLUT program). diff --git a/tests/manyloc/keineschweine/lib/sg_assets.nim b/tests/manyloc/keineschweine/lib/sg_assets.nim index 7caa9c3fb..96c962dc3 100644 --- a/tests/manyloc/keineschweine/lib/sg_assets.nim +++ b/tests/manyloc/keineschweine/lib/sg_assets.nim @@ -1,6 +1,8 @@ +import ../../../../dist/checksums/src/checksums/md5 + import re, json, strutils, tables, math, os, math_helpers, - sg_packets, md5, zlib_helpers + sg_packets, zlib_helpers when defined(NoSFML): import server_utils @@ -221,7 +223,7 @@ template cacheImpl(procName, cacheName, resultType, body: untyped) {.dirty.} = cacheName[filename] = result template checkFile(path: untyped) {.dirty.} = - if not existsFile(path): + if not fileExists(path): errors.add("File missing: " & path) cacheImpl newSprite, SpriteSheets, PSpriteSheet: @@ -322,7 +324,7 @@ proc validateSettings*(settings: JsonNode, errors: var seq[string]): bool = inc id proc loadSettingsFromFile*(filename: string, errors: var seq[string]): bool = - if not existsFile(filename): + if not fileExists(filename): errors.add("File does not exist: "&filename) else: result = loadSettings(readFile(filename), errors) diff --git a/tests/manyloc/keineschweine/lib/sg_gui.nim b/tests/manyloc/keineschweine/lib/sg_gui.nim index 83ad0d1bf..bcf415556 100644 --- a/tests/manyloc/keineschweine/lib/sg_gui.nim +++ b/tests/manyloc/keineschweine/lib/sg_gui.nim @@ -193,28 +193,28 @@ proc setActive*(t: PTextEntry) = if not t.isNil and not t.inputClient.isNil: input_helpers.setActive(t.inputClient) +when false: + proc newMessageArea*(container: PGuiContainer; position: TVector2f): PMessageArea = + new(result) + result.messages = @[] + result.pos = position + container.add(result) + proc add*(m: PMessageArea, text: string): PText = + result = messageProto.copy() + result.setString(text) + m.messages.add(result) + let nmsgs = len(m.messages) + var pos = vec2f(m.pos.x, m.pos.y) + for i in countdown(nmsgs - 1, max(nmsgs - 30, 0)): + setPosition(m.messages[i], pos) + pos.y -= 16.0 -discard """proc newMessageArea*(container: PGuiContainer; position: TVector2f): PMessageArea = - new(result) - result.messages = @[] - result.pos = position - container.add(result) -proc add*(m: PMessageArea, text: string): PText = - result = messageProto.copy() - result.setString(text) - m.messages.add(result) - let nmsgs = len(m.messages) - var pos = vec2f(m.pos.x, m.pos.y) - for i in countdown(nmsgs - 1, max(nmsgs - 30, 0)): - setPosition(m.messages[i], pos) - pos.y -= 16.0 + proc draw*(window: PRenderWindow; m: PMessageArea) = + let nmsgs = len(m.messages) + if nmsgs == 0: return + for i in countdown(nmsgs - 1, max(nmsgs - 30, 0)): + window.draw(m.messages[i]) -proc draw*(window: PRenderWindow; m: PMessageArea) = - let nmsgs = len(m.messages) - if nmsgs == 0: return - for i in countdown(nmsgs - 1, max(nmsgs - 30, 0)): - window.draw(m.messages[i]) -""" proc newMessageArea*(container: PGuiContainer; position: TVector2f): PMessageArea = new(result) result.messages = @[] diff --git a/tests/manyloc/keineschweine/lib/sg_packets.nim b/tests/manyloc/keineschweine/lib/sg_packets.nim index 0727c699a..797a60706 100644 --- a/tests/manyloc/keineschweine/lib/sg_packets.nim +++ b/tests/manyloc/keineschweine/lib/sg_packets.nim @@ -1,4 +1,6 @@ -import genpacket_enet, nativesockets, net, md5, enet +import ../../../../dist/checksums/src/checksums/md5 + +import genpacket_enet, nativesockets, net, enet defPacketImports() type diff --git a/tests/manyloc/keineschweine/lib/zlib_helpers.nim b/tests/manyloc/keineschweine/lib/zlib_helpers.nim index 895f41759..e51c000c8 100644 --- a/tests/manyloc/keineschweine/lib/zlib_helpers.nim +++ b/tests/manyloc/keineschweine/lib/zlib_helpers.nim @@ -1,21 +1,26 @@ +# xxx this test is bad (echo instead of error, etc) + import zip/zlib proc compress*(source: string): string = var sourcelen = source.len - destlen = sourcelen + (sourcelen.float * 0.1).int + 16 + destLen = sourcelen + (sourcelen.float * 0.1).int + 16 result = "" result.setLen destLen - var res = zlib.compress(cstring(result), addr destLen, cstring(source), sourceLen) + # see http://www.zlib.net/zlib-1.2.11.tar.gz for correct definitions + var destLen2 = destLen.Ulongf + var res = zlib.compress(cstring(result), addr destLen2, cstring(source), sourceLen.Ulong) if res != Z_OK: echo "Error occurred: ", res - elif destLen < result.len: - result.setLen(destLen) + elif destLen2.int < result.len: + result.setLen(destLen2.int) proc uncompress*(source: string, destLen: var int): string = result = "" result.setLen destLen - var res = zlib.uncompress(cstring(result), addr destLen, cstring(source), source.len) + var destLen2 = destLen.Ulongf + var res = zlib.uncompress(cstring(result), addr destLen2, cstring(source), source.len.Ulong) if res != Z_OK: echo "Error occurred: ", res diff --git a/tests/manyloc/keineschweine/server/old_dirserver.nim b/tests/manyloc/keineschweine/server/old_dirserver.nim index 390b738aa..a63829691 100644 --- a/tests/manyloc/keineschweine/server/old_dirserver.nim +++ b/tests/manyloc/keineschweine/server/old_dirserver.nim @@ -1,9 +1,9 @@ ## directory server ## handles client authorization and assets - +import ../../../dist/checksums/src/checksums/md5 import sockets, times, streams, streams_enh, tables, json, os, - sg_packets, sg_assets, md5, server_utils, map_filter + sg_packets, sg_assets, server_utils, map_filter type THandler = proc(client: PCLient; stream: PStream) var @@ -159,12 +159,12 @@ proc poll*(timeout: int = 250) = when true: import parseopt, strutils var cfgFile = "dirserver_settings.json" - for kind, key, val in getOpt(): + for kind, key, val in getopt(): case kind of cmdShortOption, cmdLongOption: case key of "f", "file": - if existsFile(val): + if fileExists(val): cfgFile = val else: echo("File does not exist: ", val) diff --git a/tests/manyloc/keineschweine/server/old_server_utils.nim b/tests/manyloc/keineschweine/server/old_server_utils.nim index 3da6e078c..f389c0836 100644 --- a/tests/manyloc/keineschweine/server/old_server_utils.nim +++ b/tests/manyloc/keineschweine/server/old_server_utils.nim @@ -1,5 +1,7 @@ +import ../../../dist/checksums/src/checksums/md5 + import - streams, md5, sockets, + streams, sockets, sg_packets, zlib_helpers, idgen type TClientType* = enum diff --git a/tests/manyloc/keineschweine/server/old_sg_server.nim b/tests/manyloc/keineschweine/server/old_sg_server.nim index 473880e2b..d6fbbe99e 100644 --- a/tests/manyloc/keineschweine/server/old_sg_server.nim +++ b/tests/manyloc/keineschweine/server/old_sg_server.nim @@ -144,12 +144,12 @@ proc poll*(timeout: int = 250) = when true: import parseopt, strutils var zoneCfgFile = "./server_settings.json" - for kind, key, val in getOpt(): + for kind, key, val in getopt(): case kind of cmdShortOption, cmdLongOption: case key of "f", "file": - if existsFile(val): + if fileExists(val): zoneCfgFile = val else: echo("File does not exist: ", val) @@ -165,7 +165,7 @@ when true: dirServerInfo = jsonSettings["dirserver"] var path = getAppDir()/../"data"/zoneFile - if not existsFile(path): + if not fileExists(path): echo("Zone settings file does not exist: ../data/", zoneFile) echo(path) quit(1) diff --git a/tests/manyloc/keineschweine/server/sg_lobby.nim b/tests/manyloc/keineschweine/server/sg_lobby.nim index f130e1b54..04ce10f08 100644 --- a/tests/manyloc/keineschweine/server/sg_lobby.nim +++ b/tests/manyloc/keineschweine/server/sg_lobby.nim @@ -1,6 +1,7 @@ +import ../../../dist/checksums/src/checksums/md5 import - sockets, streams, tables, times, math, strutils, json, os, md5, + sockets, streams, tables, times, math, strutils, json, os, sfml, sfml_vector, sfml_colors, streams_enh, input_helpers, zlib_helpers, client_helpers, sg_packets, sg_assets, sg_gui type @@ -51,7 +52,7 @@ proc setConnected(state: bool) = for b in connectionButtons: disable(b) proc setActiveZone(ind: int; zone: ScZoneRecord) = - #hilight it or something + #highlight it or something dispmessage("Selected " & zone.name) connectZone(zone.ip, zone.port) playBtn.enable() @@ -243,7 +244,7 @@ proc lobbyInit*() = messageArea.scrollBack -= 1 update(messageArea)) gui.newButton(text = "Flood msg area", position = vec2f(185, 30), onClick = proc(b: PButton) = - for i in 0.. <30: + for i in 0..< 30: dispMessage($i)) var i = 0 diff --git a/tests/manyloc/nake/nake.nim b/tests/manyloc/nake/nake.nim index ebcf21d19..5d3173a20 100644 --- a/tests/manyloc/nake/nake.nim +++ b/tests/manyloc/nake/nake.nim @@ -51,7 +51,7 @@ template withDir*(dir: string; body: untyped) = cd(curDir) when true: - if not existsFile("nakefile.nim"): + if not fileExists("nakefile.nim"): echo "No nakefile.nim found. Current working dir is ", getCurrentDir() quit 1 var args = "" @@ -60,11 +60,12 @@ when true: args.add " " quit(shell("nim", "c", "-r", "nakefile.nim", args)) else: - addQuitProc(proc() {.noconv.} = + import std/exitprocs + addExitProc(proc() {.noconv.} = var task: string printTaskList: bool - for kind, key, val in getOpt(): + for kind, key, val in getopt(): case kind of cmdLongOption, cmdShortOption: case key.tolowerAscii diff --git a/tests/manyloc/nake/nakefile.nim b/tests/manyloc/nake/nakefile.nim index 35ed3cbb0..fc479a5c2 100644 --- a/tests/manyloc/nake/nakefile.nim +++ b/tests/manyloc/nake/nakefile.nim @@ -29,11 +29,12 @@ task "test2", "Build release test build test release build": if shell("nim", ReleaseDefines, ReleaseTestDefines, "compile", ExeName) == 0: shell "."/ExeName -discard """task "dirserver", "build the directory server": - withDir "server": - if shell("nim", ServerDefines, "compile", "dirserver") != 0: - echo "Failed to build the dirserver" - quit 1""" +when false: + task "dirserver", "build the directory server": + withDir "server": + if shell("nim", ServerDefines, "compile", "dirserver") != 0: + echo "Failed to build the dirserver" + quit 1 task "zoneserver", "build the zone server": withDir "enet_server": @@ -63,7 +64,7 @@ task "release", "release build": ## zip up all the files and such or something useful here task "testskel", "create skeleton test dir for testing": - let dirname = "test-"& $random(5000) + let dirname = "test-" & $rand(5000) removeDir dirName createDir dirName/"data/fnt" copyFile "data/fnt/LiberationMono-Regular", dirName/"data/fnt/LiberationMono-Regular.ttf" @@ -77,7 +78,7 @@ task "testskel", "create skeleton test dir for testing": task "clean", "cleanup generated files": var dirs = @["nimcache", "server"/"nimcache"] dirs.apply(proc(x: var string) = - if existsDir(x): removeDir(x)) + if dirExists(x): removeDir(x)) task "download", "download game assets": var @@ -86,7 +87,7 @@ task "download", "download game assets": client = newHttpClient() path.add DirSep path.add(extractFilename(GameAssets)) - if existsFile(path): + if fileExists(path): echo "The file already exists\n", "[R]emove [M]ove [Q]uit [S]kip Source: ", GameAssets case stdin.readLine.toLowerAscii @@ -133,7 +134,7 @@ task "download", "download game assets": else: ## this crashes, dunno why var z: TZipArchive - destDir = getCurrentDir()/("unzip"& $random(5000)) + destDir = getCurrentDir()/("unzip" & $rand(5000)) if not z.open(path, fmRead): echo "Could not open zip, bad download?" return diff --git a/tests/manyloc/named_argument_bug/tri_engine/gfx/gl/gl.nim b/tests/manyloc/named_argument_bug/tri_engine/gfx/gl/gl.nim index 7d787c07b..29e23f9d0 100644 --- a/tests/manyloc/named_argument_bug/tri_engine/gfx/gl/gl.nim +++ b/tests/manyloc/named_argument_bug/tri_engine/gfx/gl/gl.nim @@ -53,7 +53,7 @@ else: const glRealType* = cGLfloat -proc setUniformV4*[T](loc: GLint, vecs: var openarray[TV4[T]]) = +proc setUniformV4*[T](loc: GLint, vecs: var openArray[TV4[T]]) = glUniform4fv(loc, vecs.len.GLsizei, cast[ptr GLfloat](vecs[0].addr)) proc setUniformV4*[T](loc: GLint, vec: TV4[T]) = diff --git a/tests/manyloc/named_argument_bug/tri_engine/gfx/gl/primitive.nim b/tests/manyloc/named_argument_bug/tri_engine/gfx/gl/primitive.nim index 8c26c04eb..accc2d96b 100644 --- a/tests/manyloc/named_argument_bug/tri_engine/gfx/gl/primitive.nim +++ b/tests/manyloc/named_argument_bug/tri_engine/gfx/gl/primitive.nim @@ -47,7 +47,7 @@ proc newVert*(rect: rect.TRect): seq[TVert] = proc newVertAttrib(i: GLuint, size: GLint, stride: GLsizei, offset: GLvoid): TVertAttrib = TVertAttrib(i: i, size: size, stride: stride, offset: offset) -proc genBuf*[T](vboTarget, objUsage: GLenum, data: var openarray[T]): GLuint = +proc genBuf*[T](vboTarget, objUsage: GLenum, data: var openArray[T]): GLuint = result = 0.GLuint ?glGenBuffers(1, result.addr) ?glBindBuffer(vboTarget, result) @@ -61,7 +61,7 @@ proc newPrimitive*(verts: var seq[TVert], color=white(), z: TZ_range=0): PPrimitive = var indices = newSeq[GLushort](verts.len) - for i in 0 .. <verts.len: + for i in 0 ..< verts.len: indices[i] = i.GLushort new(result) @@ -108,7 +108,7 @@ proc updVerts*(o: PPrimitive, start, `end`: int, f: proc(i: int, vert: var TVert cast[GLvoid](cast[int](o.verts[0].addr) + byteOffset)) proc updAllVerts(o: PPrimitive, f: proc(i: int, vert: var TVert)) = - for i in 0 .. <o.verts.len: + for i in 0 ..< o.verts.len: f(i, o.verts[i]) ?glBindBuffer(GLarrayBuffer, o.arrBufId) @@ -132,7 +132,7 @@ proc newVertCircle*(circle: TCircle, nSegs: Natural=0): seq[TVert] = result = newSeq[TVert](nSegs) #result[0] = newVert(circle.p, newV2xy(0.5)) - for i in 1 .. <nSegs: + for i in 1 ..< nSegs: let pos = newV2(x + circle.p.x, y + circle.p.y) let texCoord = pos * newV2xy(1.0 / circle.r) diff --git a/tests/manyloc/named_argument_bug/tri_engine/math/vec.nim b/tests/manyloc/named_argument_bug/tri_engine/math/vec.nim index 926958fe4..18ede6100 100644 --- a/tests/manyloc/named_argument_bug/tri_engine/math/vec.nim +++ b/tests/manyloc/named_argument_bug/tri_engine/math/vec.nim @@ -14,7 +14,7 @@ type # TODO: Change to TVT when compiler issue is resolved. proc `$`*[T](o: TV2[T]): string = result = "(" - for i in 0 .. <o.len: + for i in 0 ..< o.len: result &= $o[0] if i != o.len - 1: result &= ", " @@ -47,7 +47,7 @@ proc `+`*(lhs: TV2[TR], rhs: TV2[TR]): TV2[TR] = # result += a[i] * b[i] proc dot[T](a, b: TV2[T]): T = - for i in 0 .. <a.len: + for i in 0 ..< a.len: result += a[i] * b[i] assert dot(newV2(), newV2()) == 0.0 diff --git a/tests/manyloc/standalone/panicoverride.nim b/tests/manyloc/standalone/panicoverride.nim index d9b3f4388..c0b8bb030 100644 --- a/tests/manyloc/standalone/panicoverride.nim +++ b/tests/manyloc/standalone/panicoverride.nim @@ -11,9 +11,4 @@ proc panic(s: string) {.noreturn.} = rawoutput(s) exit(1) -# Alternatively we also could implement these 2 here: -# -# proc sysFatal(exceptn: typeDesc, message: string) {.noReturn.} -# proc sysFatal(exceptn: typeDesc, message, arg: string) {.noReturn.} - {.pop.} diff --git a/tests/manyloc/standalone2/panicoverride.nim b/tests/manyloc/standalone2/panicoverride.nim new file mode 100644 index 000000000..c0b8bb030 --- /dev/null +++ b/tests/manyloc/standalone2/panicoverride.nim @@ -0,0 +1,14 @@ + +proc printf(frmt: cstring) {.varargs, importc, header: "<stdio.h>", cdecl.} +proc exit(code: int) {.importc, header: "<stdlib.h>", cdecl.} + +{.push stack_trace: off, profiler:off.} + +proc rawoutput(s: string) = + printf("%s\n", s) + +proc panic(s: string) {.noreturn.} = + rawoutput(s) + exit(1) + +{.pop.} diff --git a/tests/manyloc/standalone2/tavr.nim b/tests/manyloc/standalone2/tavr.nim new file mode 100644 index 000000000..6cbc5c699 --- /dev/null +++ b/tests/manyloc/standalone2/tavr.nim @@ -0,0 +1,7 @@ +# bug #16404 + +proc printf(frmt: cstring) {.varargs, header: "<stdio.h>", cdecl.} + +var x = 0 +inc x +printf("hi %ld\n", x+4777) diff --git a/tests/manyloc/standalone2/tavr.nim.cfg b/tests/manyloc/standalone2/tavr.nim.cfg new file mode 100644 index 000000000..2a31618d0 --- /dev/null +++ b/tests/manyloc/standalone2/tavr.nim.cfg @@ -0,0 +1,5 @@ +--gc:arc +--cpu:avr +--os:standalone +--compileOnly +--threads:off |