Browse code

Use strutils instead of snprintf (to save some bytes), set default year to 2014, partial revamp of the stopwatch

Dario Rodriguez authored on 14/01/2014 22:59:59
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,35 @@
1
+void mymemmove(void *dest, void *orig, int size)
2
+{
3
+        int i;
4
+        if(dest<orig) {
5
+                for(i=0;i<size;i++)
6
+                        ((unsigned char *)dest)[i]=((unsigned char *)orig)[i];
7
+        } else {
8
+                for(i=size-1;i>=0;i--)
9
+                        ((unsigned char *)dest)[i]=((unsigned char *)orig)[i];
10
+        }
11
+}
12
+
13
+void mymemcpy(void *dest, void *orig, int size)
14
+{
15
+        for(;size>0;size--)
16
+                *((unsigned char *)(dest++))=*((unsigned char *)(orig++));
17
+}
18
+
19
+
20
+
21
+void mymemset(void *dest, int value, int size)
22
+{
23
+	for(;size>0;size--)
24
+                *((unsigned char *)(dest++))=value;
25
+}
26
+
27
+int
28
+mystrlen(char *str)
29
+{
30
+	int l;
31
+	for(l=0;*str!='\0';l++,str++)
32
+		;
33
+	return(l);
34
+}
35
+