Fixes a bunch of lint errors
This commit is contained in:
parent
2aba6c4338
commit
fc6bb50460
11
Makefile
11
Makefile
|
@ -7,12 +7,12 @@ release:
|
|||
.PHONY: release
|
||||
|
||||
clean:
|
||||
@make clean -sC _build/debug
|
||||
@make clean -sC _build/release
|
||||
@make -sC _build/debug clean
|
||||
@make -sC _build/release clean
|
||||
.PHONY: clean
|
||||
|
||||
test:
|
||||
@make test -sC _build/debug
|
||||
@make -sC _build/debug test
|
||||
.PHONY: test
|
||||
|
||||
run: $(all)
|
||||
|
@ -24,11 +24,11 @@ playtest: $(all)
|
|||
.PHONY: playtest
|
||||
|
||||
lint:
|
||||
@make lint -sC _build/debug
|
||||
@make -sC _build/debug lint
|
||||
.PHONY: lint
|
||||
|
||||
package:
|
||||
@make package -sC _build/release
|
||||
@make -sC _build/release package
|
||||
.PHONY: package
|
||||
|
||||
setup:
|
||||
|
@ -46,4 +46,5 @@ setup:
|
|||
|
||||
teardown:
|
||||
@rm -rf _build
|
||||
@rm compile_commands.json
|
||||
.PHONY: teardown
|
||||
|
|
|
@ -47,7 +47,7 @@ actiontext_render(ActionText *t, Camera *cam)
|
|||
if (t->dead)
|
||||
return;
|
||||
|
||||
if (!t->dead && !timer_started(t->timer))
|
||||
if (!timer_started(t->timer))
|
||||
timer_start(t->timer);
|
||||
|
||||
if (timer_get_ticks(t->timer) < 500) {
|
||||
|
|
|
@ -32,7 +32,7 @@ actiontextbuilder_init(SDL_Renderer *renderer)
|
|||
}
|
||||
|
||||
void
|
||||
actiontextbuilder_create_text(const char *msg, SDL_Color color, Position *p)
|
||||
actiontextbuilder_create_text(const char *msg, SDL_Color color, const Position *p)
|
||||
{
|
||||
assert (gRenderer != NULL);
|
||||
Sprite *sprite = sprite_create();
|
||||
|
|
|
@ -34,7 +34,7 @@ void
|
|||
actiontextbuilder_render(Camera*);
|
||||
|
||||
void
|
||||
actiontextbuilder_create_text(const char *msg, SDL_Color, Position*);
|
||||
actiontextbuilder_create_text(const char *msg, SDL_Color, const Position*);
|
||||
|
||||
void
|
||||
actiontextbuilder_close(void);
|
||||
|
|
|
@ -86,7 +86,7 @@ animation_render(Animation *animation, Camera *camera)
|
|||
}
|
||||
|
||||
void
|
||||
animation_set_frames(Animation *animation, AnimationClip clips[])
|
||||
animation_set_frames(Animation *animation, const AnimationClip clips[])
|
||||
{
|
||||
for (size_t i = 0; i < animation->clipCount; i++) {
|
||||
animation->clips[i] = clips[i];
|
||||
|
|
|
@ -53,7 +53,7 @@ void
|
|||
animation_load_texture(Animation *, const char *path, SDL_Renderer*);
|
||||
|
||||
void
|
||||
animation_set_frames(Animation*, AnimationClip clips[]);
|
||||
animation_set_frames(Animation*, const AnimationClip clips[]);
|
||||
|
||||
void
|
||||
animation_run(Animation*);
|
||||
|
|
|
@ -303,7 +303,7 @@ artifact_create(MagicalEffect effect)
|
|||
}
|
||||
|
||||
Artifact *
|
||||
artifact_copy(Artifact *a)
|
||||
artifact_copy(const Artifact *a)
|
||||
{
|
||||
Artifact *new = ec_malloc(sizeof(Artifact));
|
||||
*new = *a;
|
||||
|
|
|
@ -66,7 +66,7 @@ Artifact *
|
|||
artifact_create(MagicalEffect);
|
||||
|
||||
Artifact *
|
||||
artifact_copy(Artifact*);
|
||||
artifact_copy(const Artifact*);
|
||||
|
||||
void
|
||||
artifact_render(Artifact*, Camera*);
|
||||
|
|
|
@ -204,7 +204,6 @@ create_treasure(int current_level)
|
|||
unsigned int value;
|
||||
|
||||
amt = (unsigned int) 1 + get_random(5*current_level) % 40;
|
||||
amt = amt == 0 ? 1 : amt;
|
||||
|
||||
if (current_level > 9) {
|
||||
highest_treasure = PLATINUM;
|
||||
|
|
|
@ -109,7 +109,7 @@ void* linkedlist_get(LinkedList **head, unsigned int index)
|
|||
return linkedlist_get(&(*head)->next, --index);
|
||||
}
|
||||
|
||||
void linkedlist_each(LinkedList **head, void (*fun)(void*))
|
||||
void linkedlist_each(const LinkedList **head, void (*fun)(void*))
|
||||
{
|
||||
LinkedList *next = *head;
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ void* linkedlist_poplast(LinkedList **head);
|
|||
|
||||
void* linkedlist_get(LinkedList **head, unsigned int index);
|
||||
|
||||
void linkedlist_each(LinkedList **head, void (*fun)(void*));
|
||||
void linkedlist_each(const LinkedList **head, void (*fun)(void*));
|
||||
|
||||
void linkedlist_destroy(LinkedList **head);
|
||||
|
||||
|
|
|
@ -110,7 +110,7 @@ menu_create_character_selector(void (*onCharacterSelect)(const char *), Camera *
|
|||
"Commissions/Mage.png"
|
||||
};
|
||||
|
||||
static char *callbackData[] = {
|
||||
static const char *callbackData[] = {
|
||||
"warrior",
|
||||
"rogue",
|
||||
"mage"
|
||||
|
|
|
@ -114,7 +114,7 @@ mixer_toggle_sound(void)
|
|||
}
|
||||
|
||||
bool
|
||||
mixer_toggle_music(GameState *state)
|
||||
mixer_toggle_music(const GameState *state)
|
||||
{
|
||||
Settings *settings = settings_get();
|
||||
settings->music_enabled = !settings->music_enabled;
|
||||
|
|
|
@ -79,7 +79,7 @@ bool
|
|||
mixer_toggle_sound(void);
|
||||
|
||||
bool
|
||||
mixer_toggle_music(GameState*);
|
||||
mixer_toggle_music(const GameState*);
|
||||
|
||||
void
|
||||
mixer_play_effect(Fx fx);
|
||||
|
|
|
@ -474,7 +474,7 @@ monster_coward_walk(Monster *m, RoomMatrix *rm)
|
|||
}
|
||||
|
||||
static void
|
||||
on_monster_move(Monster *m, Position *origPos, Map *map, RoomMatrix *rm)
|
||||
on_monster_move(Monster *m, const Position *origPos, Map *map, RoomMatrix *rm)
|
||||
{
|
||||
Position currentTilePos = position_to_matrix_coords(&m->sprite->pos);
|
||||
Player *player = rm->spaces[rm->playerRoomPos.x][rm->playerRoomPos.y].player;
|
||||
|
|
|
@ -64,7 +64,7 @@ load_texture(SkillBar *bar, const char *path, SDL_Renderer *renderer)
|
|||
s->dim = (Dimension) { 8, 8 };
|
||||
s->fixed = true;
|
||||
sprite_load_text_texture(s, "GUI/SDS_8x8.ttf", 0, 8, 0);
|
||||
m_sprintf(buffer, 4, "%u", i + 1 < 10 ? i + 1 : 0);
|
||||
m_sprintf(buffer, 4, "%u", i + 1);
|
||||
texture_load_from_text(s->textures[0], buffer, C_YELLOW, C_BLACK, renderer);
|
||||
linkedlist_append(&bar->sprites, s);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue