Artifacts Associated With Ticket 127ac40147407d70
- Ticket change [7d5d92c98e] (rid 2626) by anonymous on 2020-04-17 13:33:49: - comment initialized to:
<div>Dear Sean,</div><div><br /></div><div>thank you for great C-VFS. I am trying to get it working by little steps.</div><div>There might be a wiki recipe on success for the medium programmer of this wizard program.<br /></div><div><br /></div><div>Just a note. TCL and Metakit is normally C89 clean. The output of dir2c.tcl is not, as it uses this style of initialization:</div><div><br /></div><div><verbatim></div><div>static struct cvfs_data cvfs_tcl_data[] = {<br />    {<br />        /* Index 0 cannot be used because we use the value 0 to represent failure */<br />        .name  = NULL,<br />        .index = 0,<br />        .type  = 0,<br />        .size  = 0,<br />        .data  = NULL,<br />        .free  = 0,<br />    },</div><div></verbatim><br /></div><div><br /></div><div>Unfortunately, C89 does not allow to name the structure items.</div><div>The patch below transforms this output into:</div><div><br /></div><div><verbatim></div><div>static struct cvfs_data cvfs_tcl_data[] = {<br />    {<br />        /* Index 0 cannot be used because we use the value 0 to represent failure */<br />        /* name  */ NULL,<br />        /* index */ 0,<br />        /* type  */ 0,<br />        /* size  */ 0,<br />        /* data  */ NULL,<br />        /* free  */ 0,<br />    },<br /></div><div></verbatim></div><div><br /></div><div>Here is the patch:</div><div><br /></div><div><verbatim></div><div>--- C:/oehhar/elmicron/projekte/el1005_scanlink_dll/source/c-vfs/dir2c_ori.tcl    Wed Jan 22 20:53:52 2020<br />+++ C:/oehhar/elmicron/projekte/el1005_scanlink_dll/source/c-vfs/dir2c.tcl    Fri Apr 17 10:20:20 2020<br />@@ -306,20 +306,20 @@<br /> <br /> #  endif /* !LOADED_CVFS_COMMON */}<br /> puts ""<br /> <br /> puts "static struct cvfs_data ${code_tag}_data\[\] = {"<br /> puts "\t{"<br /> puts "\t\t/* Index 0 cannot be used because we use the value 0 to represent failure */"<br />-puts "\t\t.name  = NULL,"<br />-puts "\t\t.index = 0,"<br />-puts "\t\t.type  = 0,"<br />-puts "\t\t.size  = 0,"<br />-puts "\t\t.data  = NULL,"<br />-puts "\t\t.free  = 0,"<br />+puts "\t\t/* name  */ NULL,"<br />+puts "\t\t/* index */ 0,"<br />+puts "\t\t/* type  */ 0,"<br />+puts "\t\t/* size  */ 0,"<br />+puts "\t\t/* data  */ NULL,"<br />+puts "\t\t/* free  */ 0,"<br /> puts "\t},"<br /> for {set idx 1} {$idx < [llength $files]} {incr idx} {<br />     set file [lindex $files $idx]<br />     set shortfile [shorten_file $startdir $file]<br /> <br />     unset -nocomplain finfo type<br />     file stat $file finfo<br />@@ -345,20 +345,20 @@<br />             set type "CVFS_FILETYPE_DIR"<br />             set data "NULL"<br />             set size 0<br />         }<br />     }<br /> <br />     puts "\t{"<br />-    puts "\t\t.name  = \"$shortfile\","<br />-    puts "\t\t.index = $idx,"<br />-    puts "\t\t.type  = $type,"<br />-    puts "\t\t.size  = $size,"<br />-    puts "\t\t.data  = $data,"<br />-    puts "\t\t.free  = 0,"<br />+    puts "\t\t/* name  */ \"$shortfile\","<br />+    puts "\t\t/* index */ $idx,"<br />+    puts "\t\t/* type  */ $type,"<br />+    puts "\t\t/* size  */ $size,"<br />+    puts "\t\t/* data  */ $data,"<br />+    puts "\t\t/* free  */ 0,"<br />     puts "\t},"<br /> }<br /> puts "};"<br /> puts ""<br /> <br /> puts "static unsigned long ${code_tag}_lookup_index(const char *path) {"<br /> puts "\tswitch (cvfs_hash((unsigned char *) path)) {"</verbatim><br /></div><div><br /></div><div>Thank you and best regards,</div><div>Harald<br /></div>
- login: "anonymous"
- severity initialized to: "Critical"
- status initialized to: "Open"
- title initialized to: "Output C89 data from dir2c.tcl"
- type initialized to: "Code Defect"
 
- comment initialized to:
- Ticket change [44e1f208cf] (rid 2627) by anonymous on 2020-04-17 13:34:37: - foundin changed to: "trunk"
- login: "anonymous"
- mimetype: "text/x-fossil-plain"
- priority changed to: "Low"
- resolution changed to: "Open"
- severity changed to: "Minor"
- subsystem changed to: "KitDLL (The libTclkit Core)"
 
- Ticket change [35d9e39085] (rid 2633) by anonymous on 2020-05-11 16:33:18: - icomment:
Sorry, the patch has the issue, that the two members "type" and "size" are mixed up. Here is a corrected patch: <verbatim> --- C:/oehhar/elmicron/projekte/el1005_scanlink_dll/source/c-vfs/dir2c_ori.tcl Wed Jan 22 20:53:52 2020 +++ C:/oehhar/elmicron/projekte/el1005_scanlink_dll/source/c-vfs/dir2c.tcl Fri Apr 17 10:20:20 2020 @@ -306,20 +306,20 @@ # endif /* !LOADED_CVFS_COMMON */} puts "" puts "static struct cvfs_data ${code_tag}_data\[\] = {" puts "\t{" puts "\t\t/* Index 0 cannot be used because we use the value 0 to represent failure */" -puts "\t\t.name = NULL," -puts "\t\t.index = 0," -puts "\t\t.type = 0," -puts "\t\t.size = 0," -puts "\t\t.data = NULL," -puts "\t\t.free = 0," +puts "\t\t/* name */ NULL," +puts "\t\t/* index */ 0," +puts "\t\t/* size */ 0," +puts "\t\t/* type */ 0," +puts "\t\t/* data */ NULL," +puts "\t\t/* free */ 0," puts "\t}," for {set idx 1} {$idx < [llength $files]} {incr idx} { set file [lindex $files $idx] set shortfile [shorten_file $startdir $file] unset -nocomplain finfo type file stat $file finfo @@ -345,20 +345,20 @@ set type "CVFS_FILETYPE_DIR" set data "NULL" set size 0 } } puts "\t{" - puts "\t\t.name = \"$shortfile\"," - puts "\t\t.index = $idx," - puts "\t\t.type = $type," - puts "\t\t.size = $size," - puts "\t\t.data = $data," - puts "\t\t.free = 0," + puts "\t\t/* name */ \"$shortfile\"," + puts "\t\t/* index */ $idx," + puts "\t\t/* size */ $size," + puts "\t\t/* type */ $type," + puts "\t\t/* data */ $data," + puts "\t\t/* free */ 0," puts "\t}," } puts "};" puts "" puts "static unsigned long ${code_tag}_lookup_index(const char *path) {" puts "\tswitch (cvfs_hash((unsigned char *) path)) {" </verbatim>
- login: "anonymous"
- mimetype: "text/x-fossil-wiki"
- username: "oehhar"
 
- icomment:
- Ticket change [05d50f4d10] (rid 2636) by rkeene on 2020-05-11 16:42:39: - icomment:
Thanks ! The replacement for C-VFS is called XVFS by the way: https://chiselapp.com/user/rkeene/repository/xvfs/ 
- login: "rkeene"
- mimetype: "text/x-fossil-plain"
 
- icomment: