src/ccodegen.c

changeset 45
1f3835182aeb
parent 39
ac35daceb24c
child 46
534a4ef4143d
--- a/src/ccodegen.c	Tue Aug 23 15:07:29 2016 +0200
+++ b/src/ccodegen.c	Tue Aug 23 15:28:56 2016 +0200
@@ -50,7 +50,9 @@
 #define memcpy_const(darr,doff,str) memcpy(&(darr[doff]), str, sizeof(str)-1); \
                                     dp += sizeof(str)-1
 
-void cparseline(char *src, char *dest, highlighter_t *hltr) {
+void cparseline(char *src, UcxBuffer *destbuf, highlighter_t *hltr) {
+    /* TODO: workaround for using old code with UcxBuffer */
+    char *dest = destbuf->space + destbuf->pos;
 
     memset(hltr->word, 0, WORDBUF_SIZE);
     size_t wp = 0, ifp = 0, sp = (size_t)-1, dp = 0;
@@ -191,4 +193,8 @@
         }
     } while (c != '\n');
     dest[dp] = 0;
+    
+    /* TODO: workaround */
+    destbuf->pos += dp;
+    destbuf->size += dp;
 }

mercurial