Update function signatures and stuff

This commit is contained in:
Val 2022-09-02 06:22:18 -05:00
parent 0c17a2e75a
commit 33cfec8893
2 changed files with 8 additions and 8 deletions

View File

@ -4,10 +4,10 @@
#include "chernobyl_types.h" #include "chernobyl_types.h"
u16 _main (); u16 _main ();
u16 walk (u16 r15); u16 walk (u16 r15); // unused
u16 run (); u16 run ();
u16 *create_hash_table (u16 r15, u16 r14); u16 *create_hash_table (u16 exponent, u16 size);
u16 add_to_table (u16 *table, char *username, u16 pin); u16 add_to_table (u16 *table, char *username, u16 pin);
// Return address of a buffer from the table // Return address of a buffer from the table
// r15 = buffer address. r14 // r15 = buffer address. r14

View File

@ -1,4 +1,4 @@
// Just look at the function signatures in chernobyl.h and chernobyl_stdlib.h
#include "chernobyl.h" #include "chernobyl.h"
#include <stdio.h> #include <stdio.h>
@ -21,8 +21,8 @@ u16 to_decimal (char *buf) {
int main (int argc, char **argv) { int main (int argc, char **argv) {
if (argc == 1) { if (argc == 1) {
char buf[0x600] = {0}; char buf[0x600] = {0};
while (printf(">> "), _getsn (buf, 0x5ff), !feof (stdin)) { while (printf (">> "), _getsn (buf, 0x5ff), !feof (stdin)) {
printf ("hash: %x, dec: %x\n", hash (buf), to_decimal(buf)); printf ("hash: %x, dec: %x\n", hash (buf), to_decimal (buf));
}; };
} }
@ -119,10 +119,10 @@ u16 add_to_table (u16 *table, char *username, u16 pin) {
} }
r12 >>= 2; r12 >>= 2;
if (table[0] < r12) { // if there are more names in table than 10: if (table[0] < r12) { // if there are more names in table than 10:
rehash(*table, r14); // Make more boxes, and shuffle them around? rehash (*table, r14); // Make more boxes, and shuffle them around?
} }
table[0]++; table[0]++;
hash(r14); hash (r14);
r12 = 1 << table[1]; r12 = 1 << table[1];
// Then do some boring stuff // Then do some boring stuff
return 0; return 0;