]> git.sur5r.net Git - c128-kasse/blobdiff - kasse.c
fix
[c128-kasse] / kasse.c
diff --git a/kasse.c b/kasse.c
index c4cb98b6afab8fccade277b51752a16eb9356bb5..8112a5a71c71b5d38f9e3832d27fbcf2a4da8edb 100644 (file)
--- a/kasse.c
+++ b/kasse.c
@@ -2,10 +2,11 @@
 #include <conio.h>
 #include <stdlib.h>
 
+#include "config.h"
 #include "kasse.h"
 // conf
 // drucker 4 oder 5
-// preise+getraenke
+// pricee+getraenke
 //
 // graphic 4,0,10
 
@@ -17,8 +18,8 @@ void print_screen() {
        clrscr();
        printf("C128-Kassenprogramm\n\n");
        printf("Eingenommen: %d Euro, Verkauft: %d Flaschen\n\n", money * 100, items_sold);
-       for (; i < NUM_ITEMS; ++i)
-               printf("Item %x: %s (%d Cents, %d mal verkauft)\n", i, status[i].item_name, status[i].preis, status[i].times_sold);
+       for (; i < num_items; ++i)
+               printf("Item %x: %s (%d Cents, %d mal verkauft)\n", i, status[i].item_name, status[i].price, status[i].times_sold);
        printf("\nBefehle: s) Save Data\n");
 }
 
@@ -28,7 +29,7 @@ void save_data() {
 
 void buy(uc n) {
        int negative = 1;
-       uc entered[5] = {49, 0, 0, 0, 0};
+       char entered[5] = {49, 0, 0, 0, 0};
        uc i = 0;
        uc c;
        int einheiten;
@@ -47,7 +48,7 @@ void buy(uc n) {
                }
                einheiten = atoi(entered) * negative;
                status[n].times_sold += einheiten;
-               money += status[n].preis * einheiten;
+               money += status[n].price * einheiten;
                items_sold += einheiten;
        }
 }
@@ -56,12 +57,12 @@ int main() {
        static uc c;
        /* TODO: remove */
        status[0].item_name = "cola";
-       status[0].preis = 230;
+       status[0].price = 230;
        status[0].times_sold = 0;
        status[1].item_name = "mate";
-       status[1].preis = 150;
+       status[1].price = 150;
        status[0].times_sold = 0;
-       for (c = 2; c < NUM_ITEMS; ++c)
+       for (c = 2; c < MAX_ITEMS; ++c)
                status[c].item_name = NULL;
        while (1) {
                /* Bildschirm anzeigen */