summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--compiler/llstream.nim2
-rw-r--r--lib/core/macros.nim2
-rw-r--r--lib/pure/collections/critbits.nim16
-rw-r--r--lib/pure/collections/sequtils.nim18
-rw-r--r--lib/wrappers/openssl.nim8
5 files changed, 23 insertions, 23 deletions
diff --git a/compiler/llstream.nim b/compiler/llstream.nim
index 69a6905af..9cbca4c4b 100644
--- a/compiler/llstream.nim
+++ b/compiler/llstream.nim
@@ -97,7 +97,7 @@ proc continueLine(line: string, inTripleString: bool): bool {.inline.} =
 
 proc countTriples(s: string): int =
   var i = 0
-  while i < s.len:
+  while i+2 < s.len:
     if s[i] == '"' and s[i+1] == '"' and s[i+2] == '"':
       inc result
       inc i, 2
diff --git a/lib/core/macros.nim b/lib/core/macros.nim
index 0892ad434..fa8a682ad 100644
--- a/lib/core/macros.nim
+++ b/lib/core/macros.nim
@@ -1420,7 +1420,7 @@ proc boolVal*(n: NimNode): bool {.compileTime, noSideEffect.} =
   if n.kind == nnkIntLit: n.intVal != 0
   else: n == bindSym"true" # hacky solution for now
 
-macro expandMacros*(body: typed): typed =
+macro expandMacros*(body: typed): untyped =
   ## Expands one level of macro - useful for debugging.
   ## Can be used to inspect what happens when a macro call is expanded,
   ## without altering its result.
diff --git a/lib/pure/collections/critbits.nim b/lib/pure/collections/critbits.nim
index 493ae1ab6..4dddecd36 100644
--- a/lib/pure/collections/critbits.nim
+++ b/lib/pure/collections/critbits.nim
@@ -17,7 +17,7 @@ include "system/inclrtl"
 type
   NodeObj[T] {.acyclic.} = object
     byte: int ## byte index of the difference
-    otherbits: char
+    otherBits: char
     case isLeaf: bool
     of false: child: array[0..1, ref NodeObj[T]]
     of true:
@@ -69,14 +69,14 @@ proc rawInsert[T](c: var CritBitTree[T], key: string): Node[T] =
     var newOtherBits = 0
     var newByte = 0
     block blockX:
-      while newbyte < key.len:
-        let ch = if newbyte < it.key.len: it.key[newbyte] else: '\0'
-        if ch != key[newbyte]:
-          newotherbits = ch.ord xor key[newbyte].ord
+      while newByte < key.len:
+        let ch = if newByte < it.key.len: it.key[newByte] else: '\0'
+        if ch != key[newByte]:
+          newOtherBits = ch.ord xor key[newByte].ord
           break blockX
-        inc newbyte
-      if newbyte < it.key.len:
-        newotherbits = it.key[newbyte].ord
+        inc newByte
+      if newByte < it.key.len:
+        newOtherBits = it.key[newByte].ord
       else:
         return it
     while (newOtherBits and (newOtherBits-1)) != 0:
diff --git a/lib/pure/collections/sequtils.nim b/lib/pure/collections/sequtils.nim
index 572aabc85..3518a7ea0 100644
--- a/lib/pure/collections/sequtils.nim
+++ b/lib/pure/collections/sequtils.nim
@@ -609,18 +609,18 @@ template anyIt*(s, pred: untyped): bool =
 
 template toSeq1(s: not iterator): untyped =
   # overload for typed but not iterator
-  type outType = type(items(s))
+  type OutType = type(items(s))
   when compiles(s.len):
     block:
       evalOnceAs(s2, s, compiles((let _ = s)))
       var i = 0
-      var result = newSeq[outType](s2.len)
+      var result = newSeq[OutType](s2.len)
       for it in s2:
         result[i] = it
         i += 1
       result
   else:
-    var result: seq[outType] = @[]
+    var result: seq[OutType] = @[]
     for it in s:
       result.add(it)
     result
@@ -636,8 +636,8 @@ template toSeq2(iter: iterator): untyped =
       inc i
     result
   else:
-    type outType = type(iter2())
-    var result: seq[outType] = @[]
+    type OutType = type(iter2())
+    var result: seq[OutType] = @[]
     when compiles(iter2()):
       evalOnceAs(iter4, iter, false)
       let iter3 = iter4()
@@ -819,12 +819,12 @@ template mapIt*(s: typed, op: untyped): untyped =
     assert strings == @["4", "8", "12", "16"]
 
   when defined(nimHasTypeof):
-    type outType = typeof((
+    type OutType = typeof((
       block:
         var it{.inject.}: typeof(items(s), typeOfIter);
         op), typeOfProc)
   else:
-    type outType = type((
+    type OutType = type((
       block:
         var it{.inject.}: type(items(s));
         op))
@@ -836,13 +836,13 @@ template mapIt*(s: typed, op: untyped): untyped =
       evalOnceAs(s2, s, compiles((let _ = s)))
 
       var i = 0
-      var result = newSeq[outType](s2.len)
+      var result = newSeq[OutType](s2.len)
       for it {.inject.} in s2:
         result[i] = op
         i += 1
       result
   else:
-    var result: seq[outType] = @[]
+    var result: seq[OutType] = @[]
     for it {.inject.} in s:
       result.add(op)
     result
diff --git a/lib/wrappers/openssl.nim b/lib/wrappers/openssl.nim
index 03d6755c3..dc9587d2c 100644
--- a/lib/wrappers/openssl.nim
+++ b/lib/wrappers/openssl.nim
@@ -427,11 +427,11 @@ when not useWinVersion and not defined(macosx) and not defined(android) and not
     dynlib: DLLUtilName, importc.}
 
   proc allocWrapper(size: int): pointer {.cdecl.} = allocShared(size)
-  proc reallocWrapper(p: pointer; newsize: int): pointer {.cdecl.} =
+  proc reallocWrapper(p: pointer; newSize: int): pointer {.cdecl.} =
     if p == nil:
-      if newSize > 0: result = allocShared(newsize)
-    elif newsize == 0: deallocShared(p)
-    else: result = reallocShared(p, newsize)
+      if newSize > 0: result = allocShared(newSize)
+    elif newSize == 0: deallocShared(p)
+    else: result = reallocShared(p, newSize)
   proc deallocWrapper(p: pointer) {.cdecl.} =
     if p != nil: deallocShared(p)