No return on end of void functions.

This commit is contained in:
Murilo Pereira
2011-05-08 16:58:18 -03:00
parent f86f3357ae
commit ea9ff3cfb5
18 changed files with 0 additions and 164 deletions

View File

@@ -12,8 +12,6 @@ void allocate_card(struct card **card) {
}
allocate_frame(&((*card)->frame));
return;
}
void initialize_card(struct card *card) {
@@ -21,8 +19,6 @@ void initialize_card(struct card *card) {
card->value = NO_VALUE;
card->suit = NO_SUIT;
card->face = NO_FACE;
return;
}
struct card *duplicate_card(struct card *card) {
@@ -44,8 +40,6 @@ void free_card(struct card *card) {
free_frame(card->frame);
}
free(card);
return;
}
void set_card(struct card *card,
@@ -58,18 +52,12 @@ void set_card(struct card *card,
card->value = value;
card->suit = suit;
card->face = face;
return;
}
void expose_card(struct card *card) {
card->face = EXPOSED;
return;
}
void cover_card(struct card *card) {
card->face = COVERED;
return;
}

View File

@@ -13,15 +13,11 @@ void allocate_cursor(struct cursor **cursor) {
fprintf(stderr, "%s: %s (%s:%d)\n", program_name, strerror(errno), __FILE__, __LINE__ - 1);
exit(errno);
}
return;
}
void initialize_cursor(struct cursor *cursor) {
cursor->x = CURSOR_STARTING_X;
cursor->y = CURSOR_STARTING_Y;
return;
}
void move_cursor(struct cursor *cursor, enum movement movement) {
@@ -90,6 +86,4 @@ void move_cursor(struct cursor *cursor, enum movement movement) {
* on the maneuvre's stacks causes */
refresh();
draw_deck(deck);
return;
}

View File

@@ -26,8 +26,6 @@ void allocate_deck(struct deck **deck) {
allocate_stack(&((*deck)->maneuvre_4));
allocate_stack(&((*deck)->maneuvre_5));
allocate_stack(&((*deck)->maneuvre_6));
return;
}
void initialize_deck(struct deck *deck) {
@@ -46,8 +44,6 @@ void initialize_deck(struct deck *deck) {
initialize_stack(deck->maneuvre_4);
initialize_stack(deck->maneuvre_5);
initialize_stack(deck->maneuvre_6);
return;
}
void free_deck(struct deck *deck) {
@@ -68,6 +64,4 @@ void free_deck(struct deck *deck) {
free_stack(deck->maneuvre_6);
}
free(deck);
return;
}

View File

@@ -74,8 +74,6 @@ void draw_value(struct card *card) {
4,
6 - (strlen(card_value(card->value)) - 1),
card_value(card->value));
return;
}
void draw_suit(struct card *card) {
@@ -93,22 +91,16 @@ void draw_suit(struct card *card) {
} else {
wattroff(card->frame->shape, COLOR_PAIR(BLACK_ON_WHITE));
}
return;
}
void draw_front(struct card *card) {
wbkgd(card->frame->shape, COLOR_PAIR(BLACK_ON_WHITE));
draw_value(card);
draw_suit(card);
return;
}
void draw_back(struct card *card) {
wbkgd(card->frame->shape, COLOR_PAIR(WHITE_ON_BLUE));
return;
}
void draw_card(struct card *card) {
@@ -119,8 +111,6 @@ void draw_card(struct card *card) {
draw_back(card);
}
wrefresh(card->frame->shape);
return;
}
void draw_stack(struct stack *stack) {
@@ -162,18 +152,12 @@ void draw_deck(struct deck *deck) {
draw_stack(deck->maneuvre_4);
draw_stack(deck->maneuvre_5);
draw_stack(deck->maneuvre_6);
return;
}
void draw_cursor(struct cursor *cursor) {
mvaddch(cursor->y, cursor->x, '*');
return;
}
void erase_cursor(struct cursor *cursor) {
mvdelch(cursor->y, cursor->x);
return;
}

View File

@@ -10,16 +10,12 @@ void allocate_frame(struct frame **frame) {
fprintf(stderr, "%s: %s (%s:%d)\n", program_name, strerror(errno), __FILE__, __LINE__ - 1);
exit(errno);
}
return;
}
void initialize_frame(struct frame *frame) {
frame->shape = NULL;
frame->start_y = 0;
frame->start_x = 0;
return;
}
struct frame *duplicate_frame(struct frame *frame) {
@@ -36,8 +32,6 @@ void free_frame(struct frame *frame) {
delwin(frame->shape);
}
free(frame);
return;
}
void set_frame(struct frame *frame, int start_y, int start_x) {
@@ -47,6 +41,4 @@ void set_frame(struct frame *frame, int start_y, int start_x) {
FRAME_WIDTH,
frame->start_y,
frame->start_x);
return;
}

View File

@@ -126,8 +126,6 @@ static void set_stacks_initial_coordinates(struct deck *deck) {
set_frame(deck->maneuvre_6->card->frame,
MANEUVRE_STARTING_Y,
MANEUVRE_6_STARTING_X);
return;
}
static void fill_deck(struct deck *deck) {
@@ -192,8 +190,6 @@ static void fill_deck(struct deck *deck) {
for (int i = 0; i < NUMBER_OF_CARDS; i++) {
push(&(deck->stock), card[i]);
}
return;
}
static void shuffle_deck(struct deck *deck) {
@@ -222,8 +218,6 @@ static void shuffle_deck(struct deck *deck) {
for (int i = 0; i < NUMBER_OF_CARDS; i++) {
push(&(deck->stock), stack[i]->card);
}
return;
}
static void deal_cards(struct deck *deck) {
@@ -268,16 +262,12 @@ static void deal_cards(struct deck *deck) {
move_card(&(deck->stock), &(deck->maneuvre_6));
expose_card(deck->maneuvre_6->card);
return;
}
void greet_player() {
mvprintw(10, 27, "Welcome to tty-solitaire.");
mvprintw(11, 8, "Move with \u2190\u2191\u2192\u2193 or hjkl. Use the space bar to mark and move cards.");
mvprintw(12, 19, "Press the space bar to play or q to quit.");
return;
}
void initialize_game() {
@@ -300,6 +290,4 @@ void initialize_game() {
void end_game() {
free_deck(deck);
return;
}

View File

@@ -13,15 +13,11 @@ void allocate_stack(struct stack **stack) {
}
allocate_card(&((*stack)->card));
return;
}
void initialize_stack(struct stack *stack) {
initialize_card(stack->card);
stack->next = NULL;
return;
}
struct stack *duplicate_stack(struct stack *stack) {

View File

@@ -17,20 +17,14 @@ void initialize_curses() {
init_pair(2, COLOR_RED, COLOR_WHITE);
init_pair(3, COLOR_WHITE, COLOR_BLUE);
init_pair(4, COLOR_WHITE, COLOR_GREEN);
return;
}
void end_curses() {
endwin();
puts("Game finished.");
return;
}
void clear_screen() {
clear();
refresh();
return;
}