changeset 97:917b70f168b0

Some minor bug fixes string.h now defines __STRING_H Removed unneeded operations.h from dynamic test program Added string.h header to the filesystem, needed for memcpy The code for deleting files now copies the correct direntry Removed a duplicate line from the filesystem test prompt
author Jonathan Pevarnek <pevarnj@gmail.com>
date Sat, 14 May 2011 16:47:35 -0400
parents a480d02a10c8
children 28c230f0700e
files Makefile include/string.h src/dynamic.c src/fs.c src/testFS.c
diffstat 5 files changed, 14 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile	Sat May 14 12:54:47 2011 -0400
+++ b/Makefile	Sat May 14 16:47:35 2011 -0400
@@ -94,13 +94,16 @@
 
 # DO NOT DELETE
 
-src/dynamic.o: include/std.h include/die.h include/operations.h
-src/dynamic.o: include/stack.h
+src/dynamic.o: include/std.h include/die.h include/string.h include/stack.h
 src/fs.o: include/fs.h include/std.h include/die.h include/error.h
-src/fs.o: include/tod.h
+src/fs.o: include/string.h include/tod.h
 src/operations.o: include/operations.h include/std.h include/die.h
-src/operations.o: include/stack.h include/math.h
-src/sarpn.o: include/std.h include/die.h include/operations.h include/stack.h
+src/operations.o: include/stack.h include/string.h include/math.h
+src/sarpn.o: include/std.h include/die.h include/string.h
+src/sarpn.o: include/operations.h include/stack.h
+src/shell.o: include/std.h include/die.h include/error.h include/fs.h
 src/stack.o: include/stack.h include/std.h include/die.h
-src/std.o: include/std.h include/die.h
+src/std.o: include/std.h include/die.h include/string.h
+src/stdio.o: include/stdio.h include/std.h include/die.h include/string.h
+src/stdio.o: include/stdarg.h
 src/testFS.o: include/std.h include/die.h include/fs.h include/error.h
--- a/include/string.h	Sat May 14 12:54:47 2011 -0400
+++ b/include/string.h	Sat May 14 16:47:35 2011 -0400
@@ -1,5 +1,5 @@
-#ifndef __STD_H
-#define __STD_H
+#ifndef __STRING_H
+#define __STRING_H
 
 void strcpy(char *dest, const char *src);
 int strcmp(const char *a, const char *b);
--- a/src/dynamic.c	Sat May 14 12:54:47 2011 -0400
+++ b/src/dynamic.c	Sat May 14 16:47:35 2011 -0400
@@ -4,7 +4,6 @@
 
 #include <std.h>
 #include <string.h>
-#include <operations.h>
 #include <stack.h>
 
 void dumpBuffer(char *a, int b)
--- a/src/fs.c	Sat May 14 12:54:47 2011 -0400
+++ b/src/fs.c	Sat May 14 16:47:35 2011 -0400
@@ -1,5 +1,6 @@
 #include <fs.h>
 #include <std.h>
+#include <string.h>
 #include <tod.h>
 #include <error.h>
 
@@ -126,7 +127,7 @@
 		//this will fail if there is only space for one item in cache and the 2 DEs
 		//are in different blocks.  There will be no indication of failure
 	if(!end) return ERR_FSBLKREADFAIL;
-	end += numDE%DEPBLK;
+	end += numDE%DEPBLK - 1;
 	*td = *end;
 	if(isError(err = setFileSize(rootLoc, rootSize - sizeof(Direntry)))) return err;
 	if(isError(err = sync(toBlkNo))) return err; //end does not need to be synchronized
--- a/src/testFS.c	Sat May 14 12:54:47 2011 -0400
+++ b/src/testFS.c	Sat May 14 16:47:35 2011 -0400
@@ -31,7 +31,7 @@
 	if(isError(init_fs(0x100, __memsize))) goto END;
 
 	while(1) {
-		sPrint("Please select a mode:\n0: show file text\n1: make new file\n2: Append to file\n3: Delete File\n");
+		sPrint("Please select a mode:\n0: show file text\n1: make new file\n2: Append to file\n");
 		sPrint("3: Delete File\n4: Write to file\n");
 		sGet(buffer, 30);
 		int mode = atoi(buffer);