Skip to content
This repository
Browse code

v8 specific glue gen related fixes

  • Loading branch information...
commit 7f643f83252000e910d1bc121af03fa701b11f3d 1 parent ba4a560
authored
9  hosts/node-o3/sh_node.cc
@@ -17,6 +17,7 @@
17 17
  */
18 18
 #define CANVAS_USE_JPEG
19 19
 #define O3_NODE
  20
+//#define O3_V8_GLUE
20 21
 #include <v8.h>
21 22
 #include <o3.h>
22 23
 #include <js/js.h>
@@ -50,9 +51,13 @@ init (Handle<Object> target)
50 51
   o3_add_extraits(cXml);
51 52
   o3_add_extraits(cCanvas);		
52 53
   
53  
-
54  
-  iCtx* ctx = o3_new(cJs)(target, mgr,0 ,0 ,0);
  54
+// TODO: merge these two
  55
+#ifdef O3_V8_GLUE
  56
+  iCtx* ctx = o3_new(cJs)(target, mgr);
  57
+#else
  58
+  iCtx* ctx = o3_new(cJs)(target, mgr,0,0,0);
55 59
   ctx->addRef(); // will be released by a clenup callback in the cJs1
  60
+#endif
56 61
   
57 62
 }
58 63
 
2  hosts/sh/sh_win32.h
@@ -89,7 +89,7 @@ int main(int argc, char **argv) {
89 89
 
90 90
 
91 91
 	mgr->addV8ExtTraits(cCanvas::v8ExtTraits());
92  
-	mgr->addV8ExtTraits(cGlueTest::v8ExtTraits());
  92
+//	mgr->addV8ExtTraits(cGlueTest::v8ExtTraits());
93 93
 	//mgr->addExtTraits(cBarcode::extTraits());
94 94
 	//mgr->addExtTraits(cScan::extTraits());
95 95
 
4  include/cScrBuf.h
@@ -74,11 +74,11 @@ struct cScrBuf : cScr, iBuf {
74 74
 		}	
75 75
 	}
76 76
 
77  
-    o3_get size_t length()
  77
+    o3_get int length()
78 78
     {
79 79
         o3_trace_scrfun("length");
80 80
 
81  
-        return m_buf.size();
  81
+        return (int) m_buf.size();
82 82
     }
83 83
 
84 84
 	o3_fun size_t byteLength(const char* string, const char* encoding="utf8")
4  modules/canvas/cCanvas.h
@@ -52,10 +52,10 @@ namespace o3
52 52
 			return o3_new(cCanvas)();
53 53
 		}
54 54
 
55  
-		static o3_ext("cO3") o3_fun siScr canvas(size_t w, size_t h, const char* mode = "argb" )
  55
+		static o3_ext("cO3") o3_fun siScr canvas(size_t w, size_t h/*, const char* mode = "argb" */)
56 56
 		{
57 57
 			o3_trace_scrfun("canvas");
58  
-			return o3_new(cCanvas)(w,h,mode);
  58
+			return o3_new(cCanvas)(w,h,"argb");
59 59
 		}
60 60
 
61 61
 #pragma endregion O3_SCR
2  modules/js/cJs_posix.h
@@ -655,7 +655,7 @@ struct cJs : cJsBase {
655 655
 		m_template->SetIndexedPropertyHandler(indexedGetter, indexedSetter,
656 656
 			indexedQuery, indexedDeleter,
657 657
 			indexedEnumerator, data);
658  
-
  658
+addRef();
659 659
 		siScr scr(o3_new(cO3)(this, 0, 0, 0));
660 660
 		//siScr scr = o3_new(cGlueTest)();
661 661
 		object = createObject(scr);	
8  tools/codequery/parseutil.js
... ...
@@ -1,4 +1,4 @@
1  
-var treec = require("./treec");
  1
+var cq = require("./codequery");
2 2
 var fs = require('fs');
3 3
 var diff = require('./diff');
4 4
 
@@ -34,18 +34,18 @@ exports.loadFiles = function(path, filedo, filedont, lang){
34 34
 exports.loadFileList = function(list, lang){
35 35
     var opts = {};
36 36
     if(lang){
37  
-        opts.keywords = treec[lang+"keywords"];   
  37
+        opts.keywords = cq[lang+"keywords"];   
38 38
         if(lang == "c")
39 39
             opts.dontEatSemi = 1;
40 40
     }
41 41
    // lets now parse each file
42 42
     console.log("Loading...");
43 43
     for(var i = 0;i<list.length;i++){
44  
-        console.log(list[i]);
  44
+        //console.log(list[i]);
45 45
     	var f = list[i] = {name:list[i]};
46 46
     	//console.log(n.name)
47 47
     	f.data = fs.readFileSync(f.name).toString().replace(/\r?\n/g,"\n");
48  
-    	f.root = treec.parse(f.data, opts);
  48
+    	f.root = cq.parse(f.data, opts);
49 49
     	f.root.file = f;
50 50
     	f.check = f.root.toString();
51 51
         if(f.root.err)
2  tools/codequery/v8gen.js
@@ -3,7 +3,7 @@ require("./declare");
3 3
 var cq = require("./codequery");
4 4
 var pu = require('./parseutil');
5 5
 var fs = require('fs');
6  
-var files = pu.loadFiles("../../", /\.h$/, /deps|\_glue/, "c");
  6
+var files = pu.loadFiles("./", /\.h$/, /deps|\_glue/, "c");
7 7
 var OutputData = []
8 8
 var util = require('util');
9 9
 

0 notes on commit 7f643f8

Please sign in to comment.
Something went wrong with that request. Please try again.