comparison modules/string.tp @ 267:d2b70cba661e

Warning cleanup
author Michael Pavone <pavone@retrodev.com>
date Fri, 18 Jul 2014 00:14:22 -0700
parents d6a4c9e7716e
children b74956a2196f
comparison
equal deleted inserted replaced
266:75dc7161c1ca 267:d2b70cba661e
59 llMessage: "." withVars: { 59 llMessage: "." withVars: {
60 argbo <- (object ptr) 60 argbo <- (object ptr)
61 argb <- (string ptr) 61 argb <- (string ptr)
62 out <- (string ptr) 62 out <- (string ptr)
63 } andCode: :argbo { 63 } andCode: :argbo {
64 argb <- mcall: string 1 argbo 64 argb <- (mcall: string 1 argbo) castTo: (string ptr)
65 out <- make_object: (addr_of: string_meta) NULL 0 65 out <- make_object: (addr_of: string_meta) NULL 0
66 out bytes!: bytes + (argb bytes) 66 out bytes!: bytes + (argb bytes)
67 out len!: len + (argb len) 67 out len!: len + (argb len)
68 out data!: (GC_MALLOC_ATOMIC: (out bytes) + 1) 68 out data!: (GC_MALLOC_ATOMIC: (out bytes) + 1)
69 memcpy: (out data) data bytes 69 memcpy: (out data) data bytes
171 ifNotFound <- object ptr 171 ifNotFound <- object ptr
172 sneedle <- string ptr 172 sneedle <- string ptr
173 i <- uint32_t 173 i <- uint32_t
174 notFound <- uint32_t 174 notFound <- uint32_t
175 } andCode: :oneedle :startpos :ifNotFound { 175 } andCode: :oneedle :startpos :ifNotFound {
176 sneedle <- mcall: string 1 oneedle 176 sneedle <- (mcall: string 1 oneedle) castTo: (string ptr)
177 i <- startpos num 177 i <- startpos num
178 notFound <- 1 178 notFound <- 1
179 while: { notFound && i + (sneedle bytes) <= bytes} do: { 179 while: { notFound && i + (sneedle bytes) <= bytes} do: {
180 if: (memcmp: data + i (sneedle data) (sneedle bytes)) = 0 { 180 if: (memcmp: data + i (sneedle data) (sneedle bytes)) = 0 {
181 notFound <- 0 181 notFound <- 0