Remove unneeded parameter/return value
The item type parameter/return value no longer needs to be passed/returned to interact_day_item_{paste,cut}(), since the type descriptor is saved when cutting an item now. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
This commit is contained in:
parent
57c4f9d8ea
commit
81d97315c7
@ -64,7 +64,6 @@ int main(int argc, char **argv)
|
|||||||
{
|
{
|
||||||
struct day_items_nb inday;
|
struct day_items_nb inday;
|
||||||
int no_data_file = 1;
|
int no_data_file = 1;
|
||||||
int cut_item = 0;
|
|
||||||
int count;
|
int count;
|
||||||
|
|
||||||
#if ENABLE_NLS
|
#if ENABLE_NLS
|
||||||
@ -287,7 +286,7 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
case KEY_GENERIC_CUT:
|
case KEY_GENERIC_CUT:
|
||||||
if (wins_slctd() == APP && apoint_hilt() != 0) {
|
if (wins_slctd() == APP && apoint_hilt() != 0) {
|
||||||
cut_item = interact_day_item_cut(&inday.nb_events, &inday.nb_apoints);
|
interact_day_item_cut(&inday.nb_events, &inday.nb_apoints);
|
||||||
inday = do_storage(0);
|
inday = do_storage(0);
|
||||||
wins_update(FLAG_CAL | FLAG_APP);
|
wins_update(FLAG_CAL | FLAG_APP);
|
||||||
}
|
}
|
||||||
@ -295,8 +294,7 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
case KEY_GENERIC_PASTE:
|
case KEY_GENERIC_PASTE:
|
||||||
if (wins_slctd() == APP) {
|
if (wins_slctd() == APP) {
|
||||||
interact_day_item_paste(&inday.nb_events, &inday.nb_apoints, cut_item);
|
interact_day_item_paste(&inday.nb_events, &inday.nb_apoints);
|
||||||
cut_item = 0;
|
|
||||||
inday = do_storage(0);
|
inday = do_storage(0);
|
||||||
wins_update(FLAG_CAL | FLAG_APP);
|
wins_update(FLAG_CAL | FLAG_APP);
|
||||||
}
|
}
|
||||||
|
@ -717,8 +717,8 @@ void interact_day_item_edit(void);
|
|||||||
void interact_day_item_pipe(void);
|
void interact_day_item_pipe(void);
|
||||||
void interact_day_item_repeat(void);
|
void interact_day_item_repeat(void);
|
||||||
void interact_day_item_cut_free();
|
void interact_day_item_cut_free();
|
||||||
int interact_day_item_cut(unsigned *, unsigned *);
|
void interact_day_item_cut(unsigned *, unsigned *);
|
||||||
void interact_day_item_paste(unsigned *, unsigned *, int);
|
void interact_day_item_paste(unsigned *, unsigned *);
|
||||||
void interact_todo_add(void);
|
void interact_todo_add(void);
|
||||||
void interact_todo_delete(void);
|
void interact_todo_delete(void);
|
||||||
void interact_todo_edit(void);
|
void interact_todo_edit(void);
|
||||||
|
@ -883,13 +883,13 @@ void interact_day_item_cut_free(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Cut an item, so that it can be pasted somewhere else later. */
|
/* Cut an item, so that it can be pasted somewhere else later. */
|
||||||
int interact_day_item_cut(unsigned *nb_events, unsigned *nb_apoints)
|
void interact_day_item_cut(unsigned *nb_events, unsigned *nb_apoints)
|
||||||
{
|
{
|
||||||
const int NBITEMS = *nb_apoints + *nb_events;
|
const int NBITEMS = *nb_apoints + *nb_events;
|
||||||
int to_be_removed;
|
int to_be_removed;
|
||||||
|
|
||||||
if (NBITEMS == 0)
|
if (NBITEMS == 0)
|
||||||
return 0;
|
return;
|
||||||
|
|
||||||
interact_day_item_cut_free();
|
interact_day_item_cut_free();
|
||||||
struct day_item *p = day_cut_item(calendar_get_slctd_day_sec(),
|
struct day_item *p = day_cut_item(calendar_get_slctd_day_sec(),
|
||||||
@ -913,13 +913,10 @@ int interact_day_item_cut(unsigned *nb_events, unsigned *nb_apoints)
|
|||||||
apad.first_onscreen = apad.first_onscreen - to_be_removed;
|
apad.first_onscreen = apad.first_onscreen - to_be_removed;
|
||||||
if (NBITEMS == 1)
|
if (NBITEMS == 1)
|
||||||
apoint_hilt_set(0);
|
apoint_hilt_set(0);
|
||||||
|
|
||||||
return p->type;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Paste a previously cut item. */
|
/* Paste a previously cut item. */
|
||||||
void interact_day_item_paste(unsigned *nb_events, unsigned *nb_apoints,
|
void interact_day_item_paste(unsigned *nb_events, unsigned *nb_apoints)
|
||||||
int cut_item_type)
|
|
||||||
{
|
{
|
||||||
int item_type;
|
int item_type;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user