shithub: fuzz

Download patch

ref: 48b89cdab9adb510ce9dd3609055e228c9215031
parent: b75561cdc85a5a2987a17125842c60a1379e6bb9
author: seh <seh@localhost>
date: Wed Nov 14 13:50:23 EST 2018

fix build

--- a/fuzz.h
+++ b/fuzz.h
@@ -94,19 +94,20 @@
 };
 
 // Enum to track types of inputs
-typedef int type;
-enum type {
-t_int,
-t_long,
-t_DirS,
-t_charS
+typedef int tnum;
+enum tnum {
+t_int,		// int
+t_long,		// long
+t_DirS,		// Dir*
+t_charS		// char*
 };
 
 // Structure to track an instance of a given type
-typedef struct t_type t_type;
-struct t_type {
-	void *var; // Variable to track
-	type t; // Type of the variable to cast to
+typedef struct tinst tinst;
+struct tinst
+{
+	void*	var;	// Variable to track
+	tnum	t;		// Type of the variable to cast to
 };
 
 // Type names table -- in input.c
--- a/inlist.c
+++ b/inlist.c
@@ -2,23 +2,26 @@
 
 // HERE BE DRAGONS -- this should be moved to a generator
 // Generate the input list for the given syscall
+
 List*
 mkinlist(List* l, call c)
 {
+	// Iterate through l
+
 	switch(c){
-	case sc_exits	:
-	
+	case sc_exits:
+
 		break;
-	case sc_abort	:
+	case sc_abort:
 	 
 		break;
-	case sc_access	:
+	case sc_access:
 	
 		break;
-	case sc_alarm	:
+	case sc_alarm:
 	
 		break;
-	case sc_await	:
+	case sc_await:
 	
 		break;
 	case sc_bind	:
@@ -204,7 +207,10 @@
 	case sc_werrstr:
 	
 		break;
+
 	default:
 		return nil;
 	}
+
+	return nil; // Unreachable
 }
--- a/input.c
+++ b/input.c
@@ -103,7 +103,7 @@
 
 	int x;
 	for (x; x < ((sc->inputs).size); x++) {
-		fprint(logfd, "\n\t\t%s", callnames[ ((t_type*) lget(&(sc->inputs), x))->t ]);
+		//fprint(logfd, "\n\t\t%s", callnames[ ((t_type*) lget(&(sc->inputs), x))->t ]);
 	}
 }
 
--- a/mkfile
+++ b/mkfile
@@ -15,3 +15,5 @@
 MAN = fuzz.man
 
 </sys/src/cmd/mkone
+
+# Add things after this line