Permalink
Browse files

standardize on pointer * next to variable, not type, name

  • Loading branch information...
1 parent db948d6 commit 8a0cb4db186e29fee1955fcaad81b1a7402af1ac @beerriot committed Feb 28, 2011
Showing with 27 additions and 27 deletions.
  1. +7 −7 include/bggame.h
  2. +1 −1 include/bghighscore.h
  3. +2 −2 include/nkbuttons.h
  4. +2 −2 include/nkeeprom.h
  5. +7 −7 src/bggame.c
  6. +4 −4 src/bghighscore.c
  7. +2 −2 src/nkbuttons.c
  8. +2 −2 src/nkeeprom.c
View
@@ -29,16 +29,16 @@ char bggame_random_piece(game_t game);
void bggame_board_init(game_t *game);
void bggame_move_cursor(game_t game,
uint8_t buttons_pushed,
- point_t* cursor);
+ point_t *cursor);
uint8_t bggame_are_neighbor_rowcols(int rc1, int rc2, int max);
uint8_t bggame_are_neighbors(game_t game,
point_t p1,
point_t p2);
-void bggame_invalidate_selection(point_t* selection);
+void bggame_invalidate_selection(point_t *selection);
uint8_t bggame_selection_is_active(point_t selection);
-void bggame_clear_selection(game_t *game, point_t* selection);
+void bggame_clear_selection(game_t *game, point_t *selection);
void bggame_set_selection(game_t *game,
- point_t* selection,
+ point_t *selection,
point_t cursor);
int bggame_next_row(game_t game, int r);
int bggame_next_column(game_t game, int c);
@@ -51,9 +51,9 @@ uint8_t bggame_select(game_t *game,
point_t cursor,
point_t *selection);
void bggame_write_board(game_t game);
-int bggame_first_space(char* row, int width);
-void bggame_shift(char* row, int width, int start);
-int bggame_fill_spaces_row(game_t game, char* row);
+int bggame_first_space(char *row, int width);
+void bggame_shift(char *row, int width, int start);
+int bggame_fill_spaces_row(game_t game, char *row);
int bggame_fill_spaces(game_t *game);
void bggame_animate_space_fill(game_t *game);
void bggame_animate_clear_sets(game_t *game);
View
@@ -21,7 +21,7 @@ void bghighscore_write();
void bghighscore_display_line(int rank, int lcd_line);
void bghighscore_screen();
void bghighscore_alter_initials(uint8_t buttons, int rank, int i);
-int bghighscore_move_cursor(uint8_t buttons, int* i);
+int bghighscore_move_cursor(uint8_t buttons, int *i);
void bghighscore_new(int rank, uint16_t score);
void bghighscore_maybe(uint16_t score);
View
@@ -30,7 +30,7 @@ typedef struct {
void nkbuttons_init();
void nkbuttons_enable_interrupts();
void nkbuttons_disable_interrupts();
-uint8_t nkbuttons_read(nkbuttons_t* state);
-void nkbuttons_clear(nkbuttons_t* state);
+uint8_t nkbuttons_read(nkbuttons_t *state);
+void nkbuttons_clear(nkbuttons_t *state);
#endif
View
@@ -3,7 +3,7 @@
char nkeeprom_read_byte(uint16_t address);
void nkeeprom_write_byte(char byte, uint16_t address);
-void nkeeprom_read_bytes(unsigned char* dest, int offset, int count);
-void nkeeprom_write_bytes(unsigned char* src, int offset, int count);
+void nkeeprom_read_bytes(unsigned char *dest, int offset, int count);
+void nkeeprom_write_bytes(unsigned char *src, int offset, int count);
#endif
View
@@ -34,7 +34,7 @@ void bggame_board_init(game_t *game) {
// handle any directional button pushes
void bggame_move_cursor(game_t game,
uint8_t buttons_pushed,
- point_t* cursor) {
+ point_t *cursor) {
if (buttons_pushed & B_UP)
cursor->row--;
if (buttons_pushed & B_DOWN)
@@ -75,15 +75,15 @@ uint8_t bggame_are_neighbors(game_t game,
return 0;
}
-void bggame_invalidate_selection(point_t* selection) {
+void bggame_invalidate_selection(point_t *selection) {
selection->meta = 0;
}
uint8_t bggame_selection_is_active(point_t selection) {
return selection.meta != 0;
}
-void bggame_clear_selection(game_t *game, point_t* selection) {
+void bggame_clear_selection(game_t *game, point_t *selection) {
if (bggame_selection_is_active(*selection))
game->board[selection->row][selection->column] |= 0x20;
lcd_goto_position(selection->row, selection->column);
@@ -92,7 +92,7 @@ void bggame_clear_selection(game_t *game, point_t* selection) {
}
void bggame_set_selection(game_t *game,
- point_t* selection,
+ point_t *selection,
point_t cursor) {
selection->row = cursor.row;
selection->column = cursor.column;
@@ -209,20 +209,20 @@ void bggame_write_board(game_t game) {
}
}
-int bggame_first_space(char* row, int width) {
+int bggame_first_space(char *row, int width) {
int c;
for (c = 0; c < width; c++)
if (row[c] == ' ')
break;
return c;
}
-void bggame_shift(char* row, int width, int start) {
+void bggame_shift(char *row, int width, int start) {
for (; start < (width-1); start++)
row[start] = row[start+1];
}
-int bggame_fill_spaces_row(game_t game, char* row) {
+int bggame_fill_spaces_row(game_t game, char *row) {
int first_space = bggame_first_space(row, game.width);
if (first_space < game.width) {
bggame_shift(row, game.width, first_space);
View
@@ -29,7 +29,7 @@ void bghighscore_init() {
uint8_t bghighscore_checksum() {
uint8_t i, x = 0;
- unsigned char* hs = (unsigned char*)&highscores;
+ unsigned char *hs = (unsigned char*)&highscores;
for (i = 0; i < HIGH_SCORES*sizeof(bghighscore_t); i++)
x ^= *(hs+i);
return x;
@@ -66,10 +66,10 @@ void bghighscore_write() {
uint8_t x;
cli(); //disable interrupts
x = bghighscore_checksum();
- nkeeprom_write_bytes((unsigned char*)&highscores,
+ nkeeprom_write_bytes((unsigned char *)&highscores,
0,
HIGH_SCORES*sizeof(bghighscore_t));
- nkeeprom_write_bytes((unsigned char*)&x,
+ nkeeprom_write_bytes((unsigned char *)&x,
HIGH_SCORES*sizeof(bghighscore_t),
1);
sei();
@@ -112,7 +112,7 @@ void alter_highscore_initials(uint8_t buttons, int rank, int i) {
}
}
-int bghighscore_move_cursor(uint8_t buttons, int* i) {
+int bghighscore_move_cursor(uint8_t buttons, int *i) {
if (buttons & B_LEFT) {
if (*i > 0)
*i -= 1;
View
@@ -41,7 +41,7 @@ void nkbuttons_disable_interrupts() {
// check the state of the buttons, returns a mask of
// what buttons are now pushed that weren't before
-uint8_t nkbuttons_read(nkbuttons_t* state) {
+uint8_t nkbuttons_read(nkbuttons_t *state) {
// get a fresh read
uint8_t fresh = ~PINC & (B_LEFT|B_DOWN|B_UP|B_RIGHT|B_SELECT);
@@ -71,7 +71,7 @@ uint8_t nkbuttons_read(nkbuttons_t* state) {
}
// clear out all state for the button reader
-void nkbuttons_clear(nkbuttons_t* state) {
+void nkbuttons_clear(nkbuttons_t *state) {
state->stable = 0;
state->last_read = 0;
state->stable_count = 0;
View
@@ -26,12 +26,12 @@ void nkeeprom_write_byte(char byte, uint16_t address) {
EECR |= (1<<EEPE); //start write
}
-void nkeeprom_read_bytes(unsigned char* dest, int offset, int count) {
+void nkeeprom_read_bytes(unsigned char *dest, int offset, int count) {
for (; count > 0; count--, dest++, offset++)
*dest = nkeeprom_read_byte(offset);
}
-void nkeeprom_write_bytes(unsigned char* src, int offset, int count) {
+void nkeeprom_write_bytes(unsigned char *src, int offset, int count) {
for(; count > 0; count--, src++, offset++)
nkeeprom_write_byte(*src, offset);
}

0 comments on commit 8a0cb4d

Please sign in to comment.