summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rwxr-xr-xlib/core/marshal.nim46
-rwxr-xr-xlib/pure/os.nim2
-rwxr-xr-xlib/pure/pegs.nim14
-rwxr-xr-xlib/pure/times.nim6
-rwxr-xr-xlib/system.nim6
-rwxr-xr-xlib/system/alloc.nim2
-rwxr-xr-xlib/system/assign.nim10
-rwxr-xr-xlib/system/gc.nim30
-rwxr-xr-xlib/system/repr.nim46
-rwxr-xr-xlib/wrappers/expat.nim2
-rwxr-xr-xlib/wrappers/gtk/glib2.nim6
-rwxr-xr-xlib/wrappers/gtk/gtk2.nim62
-rwxr-xr-xlib/wrappers/python.nim18
-rwxr-xr-xlib/wrappers/sdl/sdl.nim4
-rwxr-xr-xlib/wrappers/x11/xlib.nim100
-rwxr-xr-xlib/wrappers/x11/xutil.nim10
16 files changed, 182 insertions, 182 deletions
diff --git a/lib/core/marshal.nim b/lib/core/marshal.nim
index 1a06e5c37..26264b1a8 100755
--- a/lib/core/marshal.nim
+++ b/lib/core/marshal.nim
@@ -101,10 +101,10 @@ proc reprSetAux(result: var string, p: pointer, typ: PNimType) =
   add result, "{"

   var u: int64

   case typ.size

-  of 1: u = ze64(cast[ptr int8](p)^)

-  of 2: u = ze64(cast[ptr int16](p)^)

-  of 4: u = ze64(cast[ptr int32](p)^)

-  of 8: u = cast[ptr int64](p)^

+  of 1: u = ze64(cast[ptr int8](p)[])

+  of 2: u = ze64(cast[ptr int16](p)[])

+  of 4: u = ze64(cast[ptr int32](p)[])

+  of 8: u = cast[ptr int64](p)[]

   else:

     var a = cast[pbyteArray](p)

     for i in 0 .. typ.size*8-1:

@@ -217,31 +217,31 @@ when not defined(useNimRtl):
     of tyArray: reprArray(result, p, typ, cl)

     of tyTuple, tyPureObject: reprRecord(result, p, typ, cl)

     of tyObject: 

-      var t = cast[ptr PNimType](p)^

+      var t = cast[ptr PNimType](p)[]

       reprRecord(result, p, t, cl)

     of tyRef, tyPtr:

       assert(p != nil)

-      if cast[ppointer](p)^ == nil: add result, "nil"

-      else: reprRef(result, cast[ppointer](p)^, typ, cl)

+      if cast[ppointer](p)[] == nil: add result, "nil"

+      else: reprRef(result, cast[ppointer](p)[], typ, cl)

     of tySequence:

-      reprSequence(result, cast[ppointer](p)^, typ, cl)

-    of tyInt: add result, $(cast[ptr int](p)^)

-    of tyInt8: add result, $int(cast[ptr Int8](p)^)

-    of tyInt16: add result, $int(cast[ptr Int16](p)^)

-    of tyInt32: add result, $int(cast[ptr Int32](p)^)

-    of tyInt64: add result, $(cast[ptr Int64](p)^)

-    of tyFloat: add result, $(cast[ptr float](p)^)

-    of tyFloat32: add result, $(cast[ptr float32](p)^)

-    of tyFloat64: add result, $(cast[ptr float64](p)^)

-    of tyEnum: add result, reprEnum(cast[ptr int](p)^, typ)

-    of tyBool: add result, reprBool(cast[ptr bool](p)^)

-    of tyChar: add result, reprChar(cast[ptr char](p)^)

-    of tyString: reprStrAux(result, cast[ptr string](p)^)

-    of tyCString: reprStrAux(result, $(cast[ptr cstring](p)^))

+      reprSequence(result, cast[ppointer](p)[], typ, cl)

+    of tyInt: add result, $(cast[ptr int](p)[])

+    of tyInt8: add result, $int(cast[ptr Int8](p)[])

+    of tyInt16: add result, $int(cast[ptr Int16](p)[])

+    of tyInt32: add result, $int(cast[ptr Int32](p)[])

+    of tyInt64: add result, $(cast[ptr Int64](p)[])

+    of tyFloat: add result, $(cast[ptr float](p)[])

+    of tyFloat32: add result, $(cast[ptr float32](p)[])

+    of tyFloat64: add result, $(cast[ptr float64](p)[])

+    of tyEnum: add result, reprEnum(cast[ptr int](p)[], typ)

+    of tyBool: add result, reprBool(cast[ptr bool](p)[])

+    of tyChar: add result, reprChar(cast[ptr char](p)[])

+    of tyString: reprStrAux(result, cast[ptr string](p)[])

+    of tyCString: reprStrAux(result, $(cast[ptr cstring](p)[]))

     of tyRange: reprAux(result, p, typ.base, cl)

     of tyProc, tyPointer:

-      if cast[ppointer](p)^ == nil: add result, "nil"

-      else: add result, reprPointer(cast[ppointer](p)^)

+      if cast[ppointer](p)[] == nil: add result, "nil"

+      else: add result, reprPointer(cast[ppointer](p)[])

     else:

       add result, "(invalid data!)"

     inc(cl.recdepth)

diff --git a/lib/pure/os.nim b/lib/pure/os.nim
index d9b81365f..67435667a 100755
--- a/lib/pure/os.nim
+++ b/lib/pure/os.nim
@@ -720,7 +720,7 @@ else:
     # retrieves the variables of char** env of C's main proc
     if not envComputed:
       when useNSGetEnviron:
-        var gEnv = NSGetEnviron()^
+        var gEnv = NSGetEnviron()[]
       var i = 0
       while True:
         if gEnv[i] == nil: break
diff --git a/lib/pure/pegs.nim b/lib/pure/pegs.nim
index 2e1d0f0ad..9b2606b33 100755
--- a/lib/pure/pegs.nim
+++ b/lib/pure/pegs.nim
@@ -120,7 +120,7 @@ proc charSet*(s: set[char]): TPeg {.nosideEffect, rtl, extern: "npegs$1".} =
   assert '\0' notin s
   result.kind = pkCharChoice
   new(result.charChoice)
-  result.charChoice^ = s
+  result.charChoice[] = s
 
 proc len(a: TPeg): int {.inline.} = return a.sons.len
 proc add(d: var TPeg, s: TPeg) {.inline.} = add(d.sons, s)
@@ -131,9 +131,9 @@ proc addChoice(dest: var TPeg, elem: TPeg) =
     # caution! Do not introduce false aliasing here!
     case elem.kind
     of pkCharChoice:
-      dest.sons[L] = charSet(dest.sons[L].charChoice^ + elem.charChoice^)
+      dest.sons[L] = charSet(dest.sons[L].charChoice[] + elem.charChoice[])
     of pkChar: 
-      dest.sons[L] = charSet(dest.sons[L].charChoice^ + {elem.ch})
+      dest.sons[L] = charSet(dest.sons[L].charChoice[] + {elem.ch})
     else: add(dest, elem)
   else: add(dest, elem)
 
@@ -435,7 +435,7 @@ proc toStrAux(r: TPeg, res: var string) =
     add(res, 'y')
     add(res, singleQuoteEsc(r.term))
   of pkChar: add(res, singleQuoteEsc(r.ch))
-  of pkCharChoice: add(res, charSetEsc(r.charChoice^))
+  of pkCharChoice: add(res, charSetEsc(r.charChoice[]))
   of pkNonTerminal: add(res, r.nt.name)
   of pkSequence:
     add(res, '(')
@@ -458,7 +458,7 @@ proc toStrAux(r: TPeg, res: var string) =
     add(res, singleQuoteEsc(r.ch))
     add(res, '*')
   of pkGreedyRepSet:
-    add(res, charSetEsc(r.charChoice^))
+    add(res, charSetEsc(r.charChoice[]))
     add(res, '*')
   of pkGreedyAny:
     add(res, ".*")
@@ -640,7 +640,7 @@ proc rawMatch*(s: string, p: TPeg, start: int, c: var TCaptures): int {.
     if p.ch == s[start]: result = 1
     else: result = -1
   of pkCharChoice:
-    if contains(p.charChoice^, s[start]): result = 1
+    if contains(p.charChoice[], s[start]): result = 1
     else: result = -1
   of pkNonTerminal:
     var oldMl = c.ml
@@ -706,7 +706,7 @@ proc rawMatch*(s: string, p: TPeg, start: int, c: var TCaptures): int {.
     while ch == s[start+result]: inc(result)
   of pkGreedyRepSet:
     result = 0
-    while contains(p.charChoice^, s[start+result]): inc(result)
+    while contains(p.charChoice[], s[start+result]): inc(result)
   of pkOption:
     result = max(0, rawMatch(s, p.sons[0], start, c))
   of pkAndPredicate:
diff --git a/lib/pure/times.nim b/lib/pure/times.nim
index f428a33b3..eddaf7e3c 100755
--- a/lib/pure/times.nim
+++ b/lib/pure/times.nim
@@ -1,7 +1,7 @@
 #
 #
 #            Nimrod's Runtime Library
-#        (c) Copyright 2010 Andreas Rumpf
+#        (c) Copyright 2011 Andreas Rumpf
 #
 #    See the file "copying.txt", included in this
 #    distribution, for details about the copyright.
@@ -246,13 +246,13 @@ when not defined(ECMAScript):
   proc getTime(): TTime = return timec(nil)
   proc getLocalTime(t: TTime): TTimeInfo =
     var a = t
-    result = tmToTimeInfo(localtime(addr(a))^)
+    result = tmToTimeInfo(localtime(addr(a))[])
     # copying is needed anyway to provide reentrancity; thus
     # the convertion is not expensive
   
   proc getGMTime(t: TTime): TTimeInfo =
     var a = t
-    result = tmToTimeInfo(gmtime(addr(a))^)
+    result = tmToTimeInfo(gmtime(addr(a))[])
     # copying is needed anyway to provide reentrancity; thus
     # the convertion is not expensive
   
diff --git a/lib/system.nim b/lib/system.nim
index c786e8355..8fc4493dd 100755
--- a/lib/system.nim
+++ b/lib/system.nim
@@ -1641,9 +1641,9 @@ when not defined(EcmaScript) and not defined(NimrodVM):
     var d: int
     var a = cast[TAddress](aa)
     case n.typ.size
-    of 1: d = ze(cast[ptr int8](a +% n.offset)^)
-    of 2: d = ze(cast[ptr int16](a +% n.offset)^)
-    of 4: d = int(cast[ptr int32](a +% n.offset)^)
+    of 1: d = ze(cast[ptr int8](a +% n.offset)[])
+    of 2: d = ze(cast[ptr int16](a +% n.offset)[])
+    of 4: d = int(cast[ptr int32](a +% n.offset)[])
     else: assert(false)
     return d
 
diff --git a/lib/system/alloc.nim b/lib/system/alloc.nim
index 0e0b450b4..c385aa6fe 100755
--- a/lib/system/alloc.nim
+++ b/lib/system/alloc.nim
@@ -195,7 +195,7 @@ proc IntSetGet(t: TIntSet, key: int): PTrunk =
 proc IntSetPut(t: var TIntSet, key: int): PTrunk = 
   result = IntSetGet(t, key)
   if result == nil:
-    result = cast[PTrunk](llAlloc(allocator, sizeof(result^)))
+    result = cast[PTrunk](llAlloc(allocator, sizeof(result[])))
     result.next = t.data[key and high(t.data)]
     t.data[key and high(t.data)] = result
     result.key = key
diff --git a/lib/system/assign.nim b/lib/system/assign.nim
index 9ac00434e..c71525a12 100755
--- a/lib/system/assign.nim
+++ b/lib/system/assign.nim
@@ -34,13 +34,13 @@ proc genericAssignAux(dest, src: Pointer, mt: PNimType, shallow: bool) =
   case mt.Kind
   of tyString:
     var x = cast[ppointer](dest)
-    var s2 = cast[ppointer](s)^
+    var s2 = cast[ppointer](s)[]
     if s2 == nil or shallow:
       unsureAsgnRef(x, s2)
     else:
       unsureAsgnRef(x, copyString(cast[NimString](s2)))
   of tySequence:
-    var s2 = cast[ppointer](src)^
+    var s2 = cast[ppointer](src)[]
     var seq = cast[PGenericSeq](s2)      
     var x = cast[ppointer](dest)
     if s2 == nil or shallow:
@@ -49,7 +49,7 @@ proc genericAssignAux(dest, src: Pointer, mt: PNimType, shallow: bool) =
       return
     assert(dest != nil)
     unsureAsgnRef(x, newObj(mt, seq.len * mt.base.size + GenericSeqSize))
-    var dst = cast[taddress](cast[ppointer](dest)^)
+    var dst = cast[taddress](cast[ppointer](dest)[])
     for i in 0..seq.len-1:
       genericAssignAux(
         cast[pointer](dst +% i*% mt.base.size +% GenericSeqSize),
@@ -67,7 +67,7 @@ proc genericAssignAux(dest, src: Pointer, mt: PNimType, shallow: bool) =
       genericAssignAux(cast[pointer](d +% i*% mt.base.size),
                        cast[pointer](s +% i*% mt.base.size), mt.base, shallow)
   of tyRef:
-    unsureAsgnRef(cast[ppointer](dest), cast[ppointer](s)^)
+    unsureAsgnRef(cast[ppointer](dest), cast[ppointer](s)[])
   else:
     copyMem(dest, src, mt.size) # copy raw bits
 
@@ -116,7 +116,7 @@ proc objectInit(dest: Pointer, typ: PNimType) =
     # iterate over any structural type
     # here we have to init the type field:
     var pint = cast[ptr PNimType](dest)
-    pint^ = typ
+    pint[] = typ
     objectInitAux(dest, typ.node)
   of tyTuple, tyPureObject:
     objectInitAux(dest, typ.node)
diff --git a/lib/system/gc.nim b/lib/system/gc.nim
index 882825f5e..eb4811bf5 100755
--- a/lib/system/gc.nim
+++ b/lib/system/gc.nim
@@ -1,7 +1,7 @@
 #
 #
 #            Nimrod's Runtime Library
-#        (c) Copyright 2010 Andreas Rumpf
+#        (c) Copyright 2011 Andreas Rumpf
 #
 #    See the file "copying.txt", included in this
 #    distribution, for details about the copyright.
@@ -244,8 +244,8 @@ proc asgnRef(dest: ppointer, src: pointer) {.compilerProc, inline.} =
   assert(not isOnStack(dest))
   # BUGFIX: first incRef then decRef!
   if src != nil: incRef(usrToCell(src))
-  if dest^ != nil: decRef(usrToCell(dest^))
-  dest^ = src
+  if dest[] != nil: decRef(usrToCell(dest[]))
+  dest[] = src
 
 proc asgnRefNoCycle(dest: ppointer, src: pointer) {.compilerProc, inline.} =
   # the code generator calls this proc if it is known at compile time that no 
@@ -253,11 +253,11 @@ proc asgnRefNoCycle(dest: ppointer, src: pointer) {.compilerProc, inline.} =
   if src != nil: 
     var c = usrToCell(src)
     discard atomicInc(c.refcount, rcIncrement)
-  if dest^ != nil: 
-    var c = usrToCell(dest^)
+  if dest[] != nil: 
+    var c = usrToCell(dest[])
     if atomicDec(c.refcount, rcIncrement) <% rcIncrement:
       rtlAddZCT(c)
-  dest^ = src
+  dest[] = src
 
 proc unsureAsgnRef(dest: ppointer, src: pointer) {.compilerProc.} =
   # unsureAsgnRef updates the reference counters only if dest is not on the
@@ -268,8 +268,8 @@ proc unsureAsgnRef(dest: ppointer, src: pointer) {.compilerProc.} =
     # XXX finally use assembler for the stack checking instead!
     # the test for '!= nil' is correct, but I got tired of the segfaults
     # resulting from the crappy stack checking:
-    if cast[int](dest^) >=% PageSize: decRef(usrToCell(dest^))
-  dest^ = src
+    if cast[int](dest[]) >=% PageSize: decRef(usrToCell(dest[]))
+  dest[] = src
 
 proc initGC() =
   when not defined(useNimRtl):
@@ -311,7 +311,7 @@ proc forAllChildrenAux(dest: Pointer, mt: PNimType, op: TWalkOp) =
       for i in 0..(mt.size div mt.base.size)-1:
         forAllChildrenAux(cast[pointer](d +% i *% mt.base.size), mt.base, op)
     of tyRef, tyString, tySequence: # leaf:
-      doOperation(cast[ppointer](d)^, op)
+      doOperation(cast[ppointer](d)[], op)
     of tyObject, tyTuple, tyPureObject:
       forAllSlotsAux(dest, mt.node, op)
     else: nil
@@ -545,7 +545,7 @@ when defined(sparc): # For SPARC architecture.
     sp = addr(stackTop[0])
     # Addresses decrease as the stack grows.
     while sp <= max:
-      gcMark(sp^)
+      gcMark(sp[])
       sp = cast[ppointer](cast[TAddress](sp) +% sizeof(pointer))
 
 elif defined(ELATE):
@@ -575,7 +575,7 @@ elif stackIncreases:
       # sp will traverse the JMP_BUF as well (jmp_buf size is added,
       # otherwise sp would be below the registers structure).
       while sp >=% max:
-        gcMark(cast[ppointer](sp)^)
+        gcMark(cast[ppointer](sp)[])
         sp = sp -% sizeof(pointer)
 
 else:
@@ -598,7 +598,7 @@ else:
       var max = cast[TAddress](stackBottom)
       var sp = cast[TAddress](addr(registers))
       while sp <=% max:
-        gcMark(cast[ppointer](sp)^)
+        gcMark(cast[ppointer](sp)[])
         sp = sp +% sizeof(pointer)
 
 # ----------------------------------------------------------------------------
@@ -611,13 +611,13 @@ proc CollectZCT(gch: var TGcHeap) =
   # avoid a deep stack, we move objects to keep the ZCT small.
   # This is performance critical!
   var L = addr(gch.zct.len)
-  while L^ > 0:
+  while L[] > 0:
     var c = gch.zct.d[0]
     # remove from ZCT:
     assert((c.refcount and colorMask) == rcZct)
     c.refcount = c.refcount and not colorMask
-    gch.zct.d[0] = gch.zct.d[L^ - 1]
-    dec(L^)
+    gch.zct.d[0] = gch.zct.d[L[] - 1]
+    dec(L[])
     if c.refcount <% rcIncrement: 
       # It may have a RC > 0, if it is in the hardware stack or
       # it has not been removed yet from the ZCT. This is because
diff --git a/lib/system/repr.nim b/lib/system/repr.nim
index b597cb0ce..a70989cad 100755
--- a/lib/system/repr.nim
+++ b/lib/system/repr.nim
@@ -78,10 +78,10 @@ proc reprSetAux(result: var string, p: pointer, typ: PNimType) =
   add result, "{"
   var u: int64
   case typ.size
-  of 1: u = ze64(cast[ptr int8](p)^)
-  of 2: u = ze64(cast[ptr int16](p)^)
-  of 4: u = ze64(cast[ptr int32](p)^)
-  of 8: u = cast[ptr int64](p)^
+  of 1: u = ze64(cast[ptr int8](p)[])
+  of 2: u = ze64(cast[ptr int16](p)[])
+  of 4: u = ze64(cast[ptr int32](p)[])
+  of 8: u = cast[ptr int64](p)[]
   else:
     var a = cast[pbyteArray](p)
     for i in 0 .. typ.size*8-1:
@@ -194,31 +194,31 @@ when not defined(useNimRtl):
     of tyArray: reprArray(result, p, typ, cl)
     of tyTuple, tyPureObject: reprRecord(result, p, typ, cl)
     of tyObject: 
-      var t = cast[ptr PNimType](p)^
+      var t = cast[ptr PNimType](p)[]
       reprRecord(result, p, t, cl)
     of tyRef, tyPtr:
       assert(p != nil)
-      if cast[ppointer](p)^ == nil: add result, "nil"
-      else: reprRef(result, cast[ppointer](p)^, typ, cl)
+      if cast[ppointer](p)[] == nil: add result, "nil"
+      else: reprRef(result, cast[ppointer](p)[], typ, cl)
     of tySequence:
-      reprSequence(result, cast[ppointer](p)^, typ, cl)
-    of tyInt: add result, $(cast[ptr int](p)^)
-    of tyInt8: add result, $int(cast[ptr Int8](p)^)
-    of tyInt16: add result, $int(cast[ptr Int16](p)^)
-    of tyInt32: add result, $int(cast[ptr Int32](p)^)
-    of tyInt64: add result, $(cast[ptr Int64](p)^)
-    of tyFloat: add result, $(cast[ptr float](p)^)
-    of tyFloat32: add result, $(cast[ptr float32](p)^)
-    of tyFloat64: add result, $(cast[ptr float64](p)^)
-    of tyEnum: add result, reprEnum(cast[ptr int](p)^, typ)
-    of tyBool: add result, reprBool(cast[ptr bool](p)^)
-    of tyChar: add result, reprChar(cast[ptr char](p)^)
-    of tyString: reprStrAux(result, cast[ptr string](p)^)
-    of tyCString: reprStrAux(result, $(cast[ptr cstring](p)^))
+      reprSequence(result, cast[ppointer](p)[], typ, cl)
+    of tyInt: add result, $(cast[ptr int](p)[])
+    of tyInt8: add result, $int(cast[ptr Int8](p)[])
+    of tyInt16: add result, $int(cast[ptr Int16](p)[])
+    of tyInt32: add result, $int(cast[ptr Int32](p)[])
+    of tyInt64: add result, $(cast[ptr Int64](p)[])
+    of tyFloat: add result, $(cast[ptr float](p)[])
+    of tyFloat32: add result, $(cast[ptr float32](p)[])
+    of tyFloat64: add result, $(cast[ptr float64](p)[])
+    of tyEnum: add result, reprEnum(cast[ptr int](p)[], typ)
+    of tyBool: add result, reprBool(cast[ptr bool](p)[])
+    of tyChar: add result, reprChar(cast[ptr char](p)[])
+    of tyString: reprStrAux(result, cast[ptr string](p)[])
+    of tyCString: reprStrAux(result, $(cast[ptr cstring](p)[]))
     of tyRange: reprAux(result, p, typ.base, cl)
     of tyProc, tyPointer:
-      if cast[ppointer](p)^ == nil: add result, "nil"
-      else: add result, reprPointer(cast[ppointer](p)^)
+      if cast[ppointer](p)[] == nil: add result, "nil"
+      else: add result, reprPointer(cast[ppointer](p)[])
     else:
       add result, "(invalid data!)"
     inc(cl.recdepth)
diff --git a/lib/wrappers/expat.nim b/lib/wrappers/expat.nim
index 940d50ed6..3400dfdf7 100755
--- a/lib/wrappers/expat.nim
+++ b/lib/wrappers/expat.nim
@@ -564,7 +564,7 @@ proc SetUserData*(parser: PParser, userData: pointer){.cdecl,
 # Returns the last value set by XML_SetUserData or NULL. 
 
 template GetUserData*(parser: expr): expr = 
-  (cast[ptr pointer]((parser))^ )
+  (cast[ptr pointer]((parser))[] )
 
 # This is equivalent to supplying an encoding argument to
 #   XML_ParserCreate. On success XML_SetEncoding returns non-zero,
diff --git a/lib/wrappers/gtk/glib2.nim b/lib/wrappers/gtk/glib2.nim
index a8fa6412d..3b40cd48f 100755
--- a/lib/wrappers/gtk/glib2.nim
+++ b/lib/wrappers/gtk/glib2.nim
@@ -3468,8 +3468,8 @@ when false:
     result = g_array_insert_vals(a, i, addr(v), 1)
 
   proc g_ptr_array_index*(parray: PGPtrArray, index: guint): gpointer = 
-    result = cast[PGPointer](cast[int](parray ^. pdata) +
-        index * SizeOf(GPointer))^ 
+    result = cast[PGPointer](cast[int](parray []. pdata) +
+        index * SizeOf(GPointer))[] 
 
   proc G_THREAD_ERROR*(): TGQuark = 
     result = g_thread_error_quark()
@@ -3754,7 +3754,7 @@ proc TGIOChannel_set_is_seekable*(a: PGIOChannel, `is_seekable`: guint) =
       bm_TGIOChannel_is_seekable)
 
 proc utf8_next_char*(p: pguchar): pguchar = 
-  result = cast[pguchar](cast[TAddress](p) + 1) # p + ord((g_utf8_skip + p^ )^ )
+  result = cast[pguchar](cast[TAddress](p) + 1) # p + ord((g_utf8_skip + p[] )[] )
   
 when false: 
   proc GLIB_CHECK_VERSION*(major, minor, micro: guint): bool = 
diff --git a/lib/wrappers/gtk/gtk2.nim b/lib/wrappers/gtk/gtk2.nim
index f1e4ec13f..747ab4840 100755
--- a/lib/wrappers/gtk/gtk2.nim
+++ b/lib/wrappers/gtk/gtk2.nim
@@ -10892,127 +10892,127 @@ proc FUNDAMENTAL_TYPE*(thetype: GType): GType =
 
 proc VALUE_CHAR*(a: TArg): gchar = 
   var a = a
-  Result = cast[ptr gchar](addr(a.d))^ 
+  Result = cast[ptr gchar](addr(a.d))[] 
 
 proc VALUE_UCHAR*(a: TArg): guchar = 
   var a = a
-  Result = cast[ptr guchar](addr(a.d))^ 
+  Result = cast[ptr guchar](addr(a.d))[] 
 
 proc VALUE_BOOL*(a: TArg): gboolean = 
   var a = a
-  Result = cast[ptr gboolean](addr(a.d))^ 
+  Result = cast[ptr gboolean](addr(a.d))[] 
 
 proc VALUE_INT*(a: TArg): gint = 
   var a = a
-  Result = cast[ptr gint](addr(a.d))^ 
+  Result = cast[ptr gint](addr(a.d))[] 
 
 proc VALUE_UINT*(a: TArg): guint = 
   var a = a
-  Result = cast[ptr guint](addr(a.d))^ 
+  Result = cast[ptr guint](addr(a.d))[] 
 
 proc VALUE_LONG*(a: TArg): glong = 
   var a = a
-  Result = cast[ptr glong](addr(a.d))^ 
+  Result = cast[ptr glong](addr(a.d))[] 
 
 proc VALUE_ULONG*(a: TArg): gulong = 
   var a = a
-  Result = cast[ptr gulong](addr(a.d))^ 
+  Result = cast[ptr gulong](addr(a.d))[] 
 
 proc VALUE_FLOAT*(a: TArg): gfloat = 
   var a = a
-  Result = cast[ptr gfloat](addr(a.d))^ 
+  Result = cast[ptr gfloat](addr(a.d))[] 
 
 proc VALUE_DOUBLE*(a: TArg): gdouble = 
   var a = a
-  Result = cast[ptr gdouble](addr(a.d))^ 
+  Result = cast[ptr gdouble](addr(a.d))[] 
 
 proc VALUE_STRING*(a: TArg): cstring = 
   var a = a
-  Result = cast[ptr cstring](addr(a.d))^ 
+  Result = cast[ptr cstring](addr(a.d))[] 
 
 proc VALUE_ENUM*(a: TArg): gint = 
   var a = a
-  Result = cast[ptr gint](addr(a.d))^ 
+  Result = cast[ptr gint](addr(a.d))[] 
 
 proc VALUE_FLAGS*(a: TArg): guint = 
   var a = a
-  Result = cast[ptr guint](addr(a.d))^ 
+  Result = cast[ptr guint](addr(a.d))[] 
 
 proc VALUE_BOXED*(a: TArg): gpointer = 
   var a = a
-  Result = cast[ptr gpointer](addr(a.d))^ 
+  Result = cast[ptr gpointer](addr(a.d))[] 
 
 proc VALUE_OBJECT*(a: TArg): PObject = 
   var a = a
-  Result = cast[ptr PObject](addr(a.d))^ 
+  Result = cast[ptr PObject](addr(a.d))[] 
 
 proc VALUE_POINTER*(a: TArg): GPointer = 
   var a = a
-  Result = cast[ptr gpointer](addr(a.d))^ 
+  Result = cast[ptr gpointer](addr(a.d))[] 
 
 proc VALUE_SIGNAL*(a: TArg): TArgSignalData = 
   var a = a
-  Result = cast[ptr TArgSignalData](addr(a.d))^ 
+  Result = cast[ptr TArgSignalData](addr(a.d))[] 
 
 proc RETLOC_CHAR*(a: TArg): cstring = 
   var a = a
-  Result = cast[ptr cstring](addr(a.d))^ 
+  Result = cast[ptr cstring](addr(a.d))[] 
 
 proc RETLOC_UCHAR*(a: TArg): Pguchar = 
   var a = a
-  Result = cast[ptr pguchar](addr(a.d))^ 
+  Result = cast[ptr pguchar](addr(a.d))[] 
 
 proc RETLOC_BOOL*(a: TArg): Pgboolean = 
   var a = a
-  Result = cast[ptr pgboolean](addr(a.d))^ 
+  Result = cast[ptr pgboolean](addr(a.d))[] 
 
 proc RETLOC_INT*(a: TArg): Pgint = 
   var a = a
-  Result = cast[ptr pgint](addr(a.d))^ 
+  Result = cast[ptr pgint](addr(a.d))[] 
 
 proc RETLOC_UINT*(a: TArg): Pguint = 
   var a = a
-  Result = cast[ptr pguint](addr(a.d))^ 
+  Result = cast[ptr pguint](addr(a.d))[] 
 
 proc RETLOC_LONG*(a: TArg): Pglong = 
   var a = a
-  Result = cast[ptr pglong](addr(a.d))^ 
+  Result = cast[ptr pglong](addr(a.d))[] 
 
 proc RETLOC_ULONG*(a: TArg): Pgulong = 
   var a = a
-  Result = cast[ptr pgulong](addr(a.d))^ 
+  Result = cast[ptr pgulong](addr(a.d))[] 
 
 proc RETLOC_FLOAT*(a: TArg): Pgfloat = 
   var a = a
-  Result = cast[ptr pgfloat](addr(a.d))^ 
+  Result = cast[ptr pgfloat](addr(a.d))[] 
 
 proc RETLOC_DOUBLE*(a: TArg): Pgdouble = 
   var a = a
-  Result = cast[ptr pgdouble](addr(a.d))^ 
+  Result = cast[ptr pgdouble](addr(a.d))[] 
 
 proc RETLOC_STRING*(a: TArg): Ppgchar = 
   var a = a
-  Result = cast[ptr Ppgchar](addr(a.d))^ 
+  Result = cast[ptr Ppgchar](addr(a.d))[] 
 
 proc RETLOC_ENUM*(a: TArg): Pgint = 
   var a = a
-  Result = cast[ptr Pgint](addr(a.d))^ 
+  Result = cast[ptr Pgint](addr(a.d))[] 
 
 proc RETLOC_FLAGS*(a: TArg): Pguint = 
   var a = a
-  Result = cast[ptr pguint](addr(a.d))^ 
+  Result = cast[ptr pguint](addr(a.d))[] 
 
 proc RETLOC_BOXED*(a: TArg): Pgpointer = 
   var a = a
-  Result = cast[ptr pgpointer](addr(a.d))^ 
+  Result = cast[ptr pgpointer](addr(a.d))[] 
 
 proc RETLOC_OBJECT*(a: TArg): PPGtkObject = 
   var a = a
-  Result = cast[ptr ppgtkobject](addr(a.d))^ 
+  Result = cast[ptr ppgtkobject](addr(a.d))[] 
 
 proc RETLOC_POINTER*(a: TArg): Pgpointer = 
   var a = a
-  Result = cast[ptr pgpointer](addr(a.d))^ 
+  Result = cast[ptr pgpointer](addr(a.d))[] 
 
 proc TYPE_WIDGET*(): GType = 
   result = widget_get_type()
diff --git a/lib/wrappers/python.nim b/lib/wrappers/python.nim
index ea9ef1fd5..0801b1ae5 100755
--- a/lib/wrappers/python.nim
+++ b/lib/wrappers/python.nim
@@ -1337,7 +1337,7 @@ proc PyImport_ExecCodeModule(name: string, codeobject: PPyObject): PPyObject =
   Py_XDECREF(v)
   modules = PyImport_GetModuleDict()
   if PyDict_GetItemString(modules, cstring(name)) == nil: 
-    PyErr_SetString(PyExc_ImportError^ , cstring(
+    PyErr_SetString(PyExc_ImportError[] , cstring(
         "Loaded module " & name & "not found in sys.modules"))
     return nil
   Py_XINCREF(m)
@@ -1371,37 +1371,37 @@ proc PyTuple_Check(obj: PPyObject): bool =
   Result = PyObject_TypeCheck(obj, PyTuple_Type)
 
 proc PyTuple_CheckExact(obj: PPyObject): bool = 
-  Result = (obj != nil) and (obj^ .ob_type == PyTuple_Type)
+  Result = (obj != nil) and (obj[].ob_type == PyTuple_Type)
 
 proc PyInstance_Check(obj: PPyObject): bool = 
-  Result = (obj != nil) and (obj^ .ob_type == PyInstance_Type)
+  Result = (obj != nil) and (obj[].ob_type == PyInstance_Type)
 
 proc PyClass_Check(obj: PPyObject): bool = 
-  Result = (obj != nil) and (obj^ .ob_type == PyClass_Type)
+  Result = (obj != nil) and (obj[].ob_type == PyClass_Type)
 
 proc PyMethod_Check(obj: PPyObject): bool = 
-  Result = (obj != nil) and (obj^ .ob_type == PyMethod_Type)
+  Result = (obj != nil) and (obj[].ob_type == PyMethod_Type)
 
 proc PyList_Check(obj: PPyObject): bool = 
   Result = PyObject_TypeCheck(obj, PyList_Type)
 
 proc PyList_CheckExact(obj: PPyObject): bool = 
-  Result = (obj != nil) and (obj^ .ob_type == PyList_Type)
+  Result = (obj != nil) and (obj[].ob_type == PyList_Type)
 
 proc PyDict_Check(obj: PPyObject): bool = 
   Result = PyObject_TypeCheck(obj, PyDict_Type)
 
 proc PyDict_CheckExact(obj: PPyObject): bool = 
-  Result = (obj != nil) and (obj^ .ob_type == PyDict_Type)
+  Result = (obj != nil) and (obj[].ob_type == PyDict_Type)
 
 proc PyModule_Check(obj: PPyObject): bool = 
   Result = PyObject_TypeCheck(obj, PyModule_Type)
 
 proc PyModule_CheckExact(obj: PPyObject): bool = 
-  Result = (obj != nil) and (obj^ .ob_type == PyModule_Type)
+  Result = (obj != nil) and (obj[].ob_type == PyModule_Type)
 
 proc PySlice_Check(obj: PPyObject): bool = 
-  Result = (obj != nil) and (obj^ .ob_type == PySlice_Type)
+  Result = (obj != nil) and (obj[].ob_type == PySlice_Type)
 
 proc PyFunction_Check(obj: PPyObject): bool = 
   Result = (obj != nil) and
diff --git a/lib/wrappers/sdl/sdl.nim b/lib/wrappers/sdl/sdl.nim
index 51dbfb3c1..8ddab49dd 100755
--- a/lib/wrappers/sdl/sdl.nim
+++ b/lib/wrappers/sdl/sdl.nim
@@ -2525,8 +2525,8 @@ proc AllocSurface(flags: int32, width, height, depth: int,
                             AMask)
 
 proc MustLock(Surface: PSurface): bool = 
-  Result = ((surface^ .offset != 0) or
-      ((surface^ .flags and (HWSURFACE or ASYNCBLIT or RLEACCEL)) != 0))
+  Result = ((surface[] .offset != 0) or
+      ((surface[] .flags and (HWSURFACE or ASYNCBLIT or RLEACCEL)) != 0))
 
 proc LockMutex(mutex: Pmutex): int = 
   Result = mutexP(mutex)
diff --git a/lib/wrappers/x11/xlib.nim b/lib/wrappers/x11/xlib.nim
index 19ebda9e0..f915f0eae 100755
--- a/lib/wrappers/x11/xlib.nim
+++ b/lib/wrappers/x11/xlib.nim
@@ -2065,154 +2065,154 @@ when defined(MACROS):
 
 when defined(MACROS): 
   proc ConnectionNumber(dpy: PDisplay): cint = 
-    ConnectionNumber = (PXPrivDisplay(dpy))^ .fd
+    ConnectionNumber = (PXPrivDisplay(dpy))[] .fd
 
   proc RootWindow(dpy: PDisplay, scr: cint): TWindow = 
-    RootWindow = (ScreenOfDisplay(dpy, scr))^ .root
+    RootWindow = (ScreenOfDisplay(dpy, scr))[] .root
 
   proc DefaultScreen(dpy: PDisplay): cint = 
-    DefaultScreen = (PXPrivDisplay(dpy))^ .default_screen
+    DefaultScreen = (PXPrivDisplay(dpy))[] .default_screen
 
   proc DefaultRootWindow(dpy: PDisplay): TWindow = 
-    DefaultRootWindow = (ScreenOfDisplay(dpy, DefaultScreen(dpy)))^ .root
+    DefaultRootWindow = (ScreenOfDisplay(dpy, DefaultScreen(dpy)))[] .root
 
   proc DefaultVisual(dpy: PDisplay, scr: cint): PVisual = 
-    DefaultVisual = (ScreenOfDisplay(dpy, scr))^ .root_visual
+    DefaultVisual = (ScreenOfDisplay(dpy, scr))[] .root_visual
 
   proc DefaultGC(dpy: PDisplay, scr: cint): TGC = 
-    DefaultGC = (ScreenOfDisplay(dpy, scr))^ .default_gc
+    DefaultGC = (ScreenOfDisplay(dpy, scr))[] .default_gc
 
   proc BlackPixel(dpy: PDisplay, scr: cint): culong = 
-    BlackPixel = (ScreenOfDisplay(dpy, scr))^ .black_pixel
+    BlackPixel = (ScreenOfDisplay(dpy, scr))[] .black_pixel
 
   proc WhitePixel(dpy: PDisplay, scr: cint): culong = 
-    WhitePixel = (ScreenOfDisplay(dpy, scr))^ .white_pixel
+    WhitePixel = (ScreenOfDisplay(dpy, scr))[] .white_pixel
 
   proc QLength(dpy: PDisplay): cint = 
-    QLength = (PXPrivDisplay(dpy))^ .qlen
+    QLength = (PXPrivDisplay(dpy))[] .qlen
 
   proc DisplayWidth(dpy: PDisplay, scr: cint): cint = 
-    DisplayWidth = (ScreenOfDisplay(dpy, scr))^ .width
+    DisplayWidth = (ScreenOfDisplay(dpy, scr))[] .width
 
   proc DisplayHeight(dpy: PDisplay, scr: cint): cint = 
-    DisplayHeight = (ScreenOfDisplay(dpy, scr))^ .height
+    DisplayHeight = (ScreenOfDisplay(dpy, scr))[] .height
 
   proc DisplayWidthMM(dpy: PDisplay, scr: cint): cint = 
-    DisplayWidthMM = (ScreenOfDisplay(dpy, scr))^ .mwidth
+    DisplayWidthMM = (ScreenOfDisplay(dpy, scr))[] .mwidth
 
   proc DisplayHeightMM(dpy: PDisplay, scr: cint): cint = 
-    DisplayHeightMM = (ScreenOfDisplay(dpy, scr))^ .mheight
+    DisplayHeightMM = (ScreenOfDisplay(dpy, scr))[] .mheight
 
   proc DisplayPlanes(dpy: PDisplay, scr: cint): cint = 
-    DisplayPlanes = (ScreenOfDisplay(dpy, scr))^ .root_depth
+    DisplayPlanes = (ScreenOfDisplay(dpy, scr))[] .root_depth
 
   proc DisplayCells(dpy: PDisplay, scr: cint): cint = 
-    DisplayCells = (DefaultVisual(dpy, scr))^ .map_entries
+    DisplayCells = (DefaultVisual(dpy, scr))[] .map_entries
 
   proc ScreenCount(dpy: PDisplay): cint = 
-    ScreenCount = (PXPrivDisplay(dpy))^ .nscreens
+    ScreenCount = (PXPrivDisplay(dpy))[] .nscreens
 
   proc ServerVendor(dpy: PDisplay): cstring = 
-    ServerVendor = (PXPrivDisplay(dpy))^ .vendor
+    ServerVendor = (PXPrivDisplay(dpy))[] .vendor
 
   proc ProtocolVersion(dpy: PDisplay): cint = 
-    ProtocolVersion = (PXPrivDisplay(dpy))^ .proto_major_version
+    ProtocolVersion = (PXPrivDisplay(dpy))[] .proto_major_version
 
   proc ProtocolRevision(dpy: PDisplay): cint = 
-    ProtocolRevision = (PXPrivDisplay(dpy))^ .proto_minor_version
+    ProtocolRevision = (PXPrivDisplay(dpy))[] .proto_minor_version
 
   proc VendorRelease(dpy: PDisplay): cint = 
-    VendorRelease = (PXPrivDisplay(dpy))^ .release
+    VendorRelease = (PXPrivDisplay(dpy))[] .release
 
   proc DisplayString(dpy: PDisplay): cstring = 
-    DisplayString = (PXPrivDisplay(dpy))^ .display_name
+    DisplayString = (PXPrivDisplay(dpy))[] .display_name
 
   proc DefaultDepth(dpy: PDisplay, scr: cint): cint = 
-    DefaultDepth = (ScreenOfDisplay(dpy, scr))^ .root_depth
+    DefaultDepth = (ScreenOfDisplay(dpy, scr))[] .root_depth
 
   proc DefaultColormap(dpy: PDisplay, scr: cint): TColormap = 
-    DefaultColormap = (ScreenOfDisplay(dpy, scr))^ .cmap
+    DefaultColormap = (ScreenOfDisplay(dpy, scr))[] .cmap
 
   proc BitmapUnit(dpy: PDisplay): cint = 
-    BitmapUnit = (PXPrivDisplay(dpy))^ .bitmap_unit
+    BitmapUnit = (PXPrivDisplay(dpy))[] .bitmap_unit
 
   proc BitmapBitOrder(dpy: PDisplay): cint = 
-    BitmapBitOrder = (PXPrivDisplay(dpy))^ .bitmap_bit_order
+    BitmapBitOrder = (PXPrivDisplay(dpy))[] .bitmap_bit_order
 
   proc BitmapPad(dpy: PDisplay): cint = 
-    BitmapPad = (PXPrivDisplay(dpy))^ .bitmap_pad
+    BitmapPad = (PXPrivDisplay(dpy))[] .bitmap_pad
 
   proc ImageByteOrder(dpy: PDisplay): cint = 
-    ImageByteOrder = (PXPrivDisplay(dpy))^ .byte_order
+    ImageByteOrder = (PXPrivDisplay(dpy))[] .byte_order
 
   proc NextRequest(dpy: PDisplay): culong = 
-    NextRequest = ((PXPrivDisplay(dpy))^ .request) + 1
+    NextRequest = ((PXPrivDisplay(dpy))[] .request) + 1
 
   proc LastKnownRequestProcessed(dpy: PDisplay): culong = 
-    LastKnownRequestProcessed = (PXPrivDisplay(dpy))^ .last_request_read
+    LastKnownRequestProcessed = (PXPrivDisplay(dpy))[] .last_request_read
 
   proc ScreenOfDisplay(dpy: PDisplay, scr: cint): PScreen = 
-    ScreenOfDisplay = addr((((PXPrivDisplay(dpy))^ .screens)[scr]))
+    ScreenOfDisplay = addr((((PXPrivDisplay(dpy))[] .screens)[scr]))
 
   proc DefaultScreenOfDisplay(dpy: PDisplay): PScreen = 
     DefaultScreenOfDisplay = ScreenOfDisplay(dpy, DefaultScreen(dpy))
 
   proc DisplayOfScreen(s: PScreen): PDisplay = 
-    DisplayOfScreen = s^ .display
+    DisplayOfScreen = s[] .display
 
   proc RootWindowOfScreen(s: PScreen): TWindow = 
-    RootWindowOfScreen = s^ .root
+    RootWindowOfScreen = s[] .root
 
   proc BlackPixelOfScreen(s: PScreen): culong = 
-    BlackPixelOfScreen = s^ .black_pixel
+    BlackPixelOfScreen = s[] .black_pixel
 
   proc WhitePixelOfScreen(s: PScreen): culong = 
-    WhitePixelOfScreen = s^ .white_pixel
+    WhitePixelOfScreen = s[] .white_pixel
 
   proc DefaultColormapOfScreen(s: PScreen): TColormap = 
-    DefaultColormapOfScreen = s^ .cmap
+    DefaultColormapOfScreen = s[] .cmap
 
   proc DefaultDepthOfScreen(s: PScreen): cint = 
-    DefaultDepthOfScreen = s^ .root_depth
+    DefaultDepthOfScreen = s[] .root_depth
 
   proc DefaultGCOfScreen(s: PScreen): TGC = 
-    DefaultGCOfScreen = s^ .default_gc
+    DefaultGCOfScreen = s[] .default_gc
 
   proc DefaultVisualOfScreen(s: PScreen): PVisual = 
-    DefaultVisualOfScreen = s^ .root_visual
+    DefaultVisualOfScreen = s[] .root_visual
 
   proc WidthOfScreen(s: PScreen): cint = 
-    WidthOfScreen = s^ .width
+    WidthOfScreen = s[] .width
 
   proc HeightOfScreen(s: PScreen): cint = 
-    HeightOfScreen = s^ .height
+    HeightOfScreen = s[] .height
 
   proc WidthMMOfScreen(s: PScreen): cint = 
-    WidthMMOfScreen = s^ .mwidth
+    WidthMMOfScreen = s[] .mwidth
 
   proc HeightMMOfScreen(s: PScreen): cint = 
-    HeightMMOfScreen = s^ .mheight
+    HeightMMOfScreen = s[] .mheight
 
   proc PlanesOfScreen(s: PScreen): cint = 
-    PlanesOfScreen = s^ .root_depth
+    PlanesOfScreen = s[] .root_depth
 
   proc CellsOfScreen(s: PScreen): cint = 
-    CellsOfScreen = (DefaultVisualOfScreen(s))^ .map_entries
+    CellsOfScreen = (DefaultVisualOfScreen(s))[] .map_entries
 
   proc MinCmapsOfScreen(s: PScreen): cint = 
-    MinCmapsOfScreen = s^ .min_maps
+    MinCmapsOfScreen = s[] .min_maps
 
   proc MaxCmapsOfScreen(s: PScreen): cint = 
-    MaxCmapsOfScreen = s^ .max_maps
+    MaxCmapsOfScreen = s[] .max_maps
 
   proc DoesSaveUnders(s: PScreen): TBool = 
-    DoesSaveUnders = s^ .save_unders
+    DoesSaveUnders = s[] .save_unders
 
   proc DoesBackingStore(s: PScreen): cint = 
-    DoesBackingStore = s^ .backing_store
+    DoesBackingStore = s[] .backing_store
 
   proc EventMaskOfScreen(s: PScreen): clong = 
-    EventMaskOfScreen = s^ .root_input_mask
+    EventMaskOfScreen = s[] .root_input_mask
 
   proc XAllocID(dpy: PDisplay): TXID = 
-    XAllocID = (PXPrivDisplay(dpy))^ .resource_alloc(dpy)
+    XAllocID = (PXPrivDisplay(dpy))[] .resource_alloc(dpy)
diff --git a/lib/wrappers/x11/xutil.nim b/lib/wrappers/x11/xutil.nim
index 563702123..b66955927 100755
--- a/lib/wrappers/x11/xutil.nim
+++ b/lib/wrappers/x11/xutil.nim
@@ -375,19 +375,19 @@ when defined(MACROS):
 
 when defined(MACROS): 
   proc XDestroyImage(ximage: PXImage): cint = 
-    XDestroyImage = ximage^ .f.destroy_image(ximage)
+    XDestroyImage = ximage[] .f.destroy_image(ximage)
 
   proc XGetPixel(ximage: PXImage, x, y: cint): culong = 
-    XGetPixel = ximage^ .f.get_pixel(ximage, x, y)
+    XGetPixel = ximage[] .f.get_pixel(ximage, x, y)
 
   proc XPutPixel(ximage: PXImage, x, y: cint, pixel: culong): cint = 
-    XPutPixel = ximage^ .f.put_pixel(ximage, x, y, pixel)
+    XPutPixel = ximage[] .f.put_pixel(ximage, x, y, pixel)
 
   proc XSubImage(ximage: PXImage, x, y: cint, width, height: cuint): PXImage = 
-    XSubImage = ximage^ .f.sub_image(ximage, x, y, width, height)
+    XSubImage = ximage[] .f.sub_image(ximage, x, y, width, height)
 
   proc XAddPixel(ximage: PXImage, value: clong): cint = 
-    XAddPixel = ximage^ .f.add_pixel(ximage, value)
+    XAddPixel = ximage[] .f.add_pixel(ximage, value)
 
   proc IsKeypadKey(keysym: TKeySym): bool = 
     IsKeypadKey = (keysym >= XK_KP_Space) and (keysym <= XK_KP_Equal)