Fixed various warnings and removed unneeded debugging prints

master
kts 2014-11-20 19:04:20 -08:00
parent ae513bd48f
commit 7bd021c515
6 changed files with 9 additions and 6 deletions

View File

@ -2,6 +2,7 @@
#include <stdlib.h> // malloc #include <stdlib.h> // malloc
#include <stdio.h> // printf, remove #include <stdio.h> // printf, remove
#include <math.h> // round #include <math.h> // round
#include <string.h> // memcpy
/* ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, /* ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
const declarations, etc. const declarations, etc.
@ -168,6 +169,7 @@ int ktk_copyMapSection(struct ktkMap *map_1, int x0, int y0, struct ktkMap *map_
} }
mx++; mx++;
} }
return 0;
} }
int ktk_mergeMaps(struct ktkMap *map_1, struct ktkMap *map_2) { int ktk_mergeMaps(struct ktkMap *map_1, struct ktkMap *map_2) {
@ -339,9 +341,6 @@ int ktk_fillEllipseBorder(struct ktkMap *map, int r_x, int r_y) {
r_x /= 2; r_x /= 2;
r_y /= 2; r_y /= 2;
int hw = r_x;
int hh = r_y;
int o_x = 0; int o_x = 0;
int o_y = 0; int o_y = 0;

View File

@ -1,6 +1,7 @@
#include "ktkProgram.h" #include "ktkProgram.h"
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <stdio.h>
int ktk_current_depth = 0; int ktk_current_depth = 0;
@ -235,6 +236,7 @@ struct ktkLive *ktk_buildStructure(struct ktkProgram *program, struct ktkLive *l
free(live); free(live);
return NULL; return NULL;
} }
return 0;
} }
int ktk_linkStructures(struct ktkProgram *program, struct ktkLive *live, struct ktkLive *new_live, struct ktkMap *orig_map) { int ktk_linkStructures(struct ktkProgram *program, struct ktkLive *live, struct ktkLive *new_live, struct ktkMap *orig_map) {

View File

@ -39,7 +39,6 @@ int ktk_getRandom(int min, int max) {
} }
int ktk_rollNumber(struct ktkNumber number) { int ktk_rollNumber(struct ktkNumber number) {
int numb = ktk_getRandom(number.a, number.b);
return (ktk_getRandom(number.a, number.b)); return (ktk_getRandom(number.a, number.b));
if (number.type == ktk_PERCENT) { if (number.type == ktk_PERCENT) {
@ -55,7 +54,7 @@ int ktk_deleteNumberSet(struct ktkNumberSet *set) {
if (set->sets != NULL) { if (set->sets != NULL) {
free(set->sets); free(set->sets);
set->sets = NULL; set->sets = NULL;
set->count = NULL; set->count = 0;
} }
return 0; return 0;
} }
@ -274,7 +273,6 @@ int ktk_deleteLive(struct ktkLive *live) {
} }
int ktk_addLiveChild(struct ktkLive *parent, struct ktkLive *child) { int ktk_addLiveChild(struct ktkLive *parent, struct ktkLive *child) {
printf("%d\n", parent->child_count);
parent->child_count++; parent->child_count++;
parent->children = realloc(parent->children, parent->child_count*sizeof(struct ktkLive*)); parent->children = realloc(parent->children, parent->child_count*sizeof(struct ktkLive*));
parent->children[parent->child_count-1] = child; parent->children[parent->child_count-1] = child;

View File

@ -65,6 +65,8 @@ struct ktkStructure {
struct ktkPath *paths; // paths struct ktkPath *paths; // paths
size_t path_count; // count of paths size_t path_count; // count of paths
}; extern const struct ktkStructure ktk_STRUCTURE_DEFAULT; }; extern const struct ktkStructure ktk_STRUCTURE_DEFAULT;
int ktk_deleteStructure(struct ktkStructure *structure);
void ktk_dumpStructure(struct ktkStructure *structure); void ktk_dumpStructure(struct ktkStructure *structure);
// live structures are similar to structures, but contain the resulting Structure // live structures are similar to structures, but contain the resulting Structure
struct ktkLive { struct ktkLive {

View File

@ -2,6 +2,7 @@
#include "ktk_parse.h" #include "ktk_parse.h"
#include "ktkProgram.h" #include "ktkProgram.h"
#include <time.h> #include <time.h>
#include <stdio.h>
int main(int argc, char *argv[]) { int main(int argc, char *argv[]) {
ktk_randomizeSeed(); ktk_randomizeSeed();

View File

@ -44,6 +44,7 @@ int drawMap(struct ktkMap *map) {
SDL_FillRect(screen, &rect, SDL_MapRGB(screen->format, red, green, blue)); SDL_FillRect(screen, &rect, SDL_MapRGB(screen->format, red, green, blue));
} }
} }
return 0;
} }
#if defined(__APPLE__) && defined(__MACH__) #if defined(__APPLE__) && defined(__MACH__)