I could not get unsigned 64bit integers to work properly, since there is no way of saving them: the only save method written for 64-bit integers requires a signed type. And I cannot find any bit shifting in relation to the code for displaying the month, although perhaps I have missed something.
The relevant code snippet is here:
sint64 ticks=1, month=0, year=0;
const ding_t *dt = wl->get_zeiger();
pos = dt->get_pos();
month = wl->get_last_month();
year = wl->get_last_year();
ticks = wl->get_zeit_ms();
// calculate also days if desired
const sint64 ticks_this_month = ticks % wl->ticks_per_tag;
uint32 tage, stunden, minuten;
if(umgebung_t::show_month>1) {
static sint32 tage_per_month[12]={31,28,31,30,31,30,31,31,30,31,30,31};
tage = ((ticks_this_month*tage_per_month[month]) >> wl->ticks_bits_per_tag) + 1;
stunden = ((ticks_this_month*tage_per_month[month]) >> (wl->ticks_bits_per_tag-16));
minuten = (((stunden*3) % 8192)*60)/8192;
stunden = ((stunden*3) / 8192)%24;
}
else {
tage = 0;
stunden = (ticks_this_month * 24) >> wl->ticks_bits_per_tag;
minuten = ((ticks_this_month * 24 * 60) >> wl->ticks_bits_per_tag)%60;
}
char time [128];
char info [256];
char stretch_text[256];
char delta_pos[64];
//DBG_MESSAGE("umgebung_t::show_month","%d",umgebung_t::show_month);
// @author hsiegeln - updated to show month
// @author prissi - also show date if desired
switch(umgebung_t::show_month) {
// german style
//#ifdef DEBUG
// case 4: sprintf(time, "%s, %d %s %d %d:%02dh TICKS: %li",
//#else
case 4: sprintf(time, "%s, %d %s %d %u:%02uh",
//#endif
translator::translate(seasons[wl->get_jahreszeit()]), //Season
tage, //Day
translator::get_month_name(month%12), //Month
year,
stunden, //"Hours" (Google)
//#ifdef DEBUG
// minuten, //Minutes
// ticks
//#else
minuten //Minutes
//#endif
);
break;
// us style
case 3: sprintf(time, "%s, %s %d %d %2d:%02d%s",
translator::translate(seasons[wl->get_jahreszeit()]),
translator::get_month_name(month%12),
tage,
year,
stunden%12,
minuten,
stunden<12 ? "am":"pm"
);
break;
// japanese style
case 2: sprintf(time, "%s, %d/%s/%d %2d:%02dh",
translator::translate(seasons[wl->get_jahreszeit()]),
year,
translator::get_month_name(month%12),
tage,
stunden,
minuten
);
break;
// just month
case 1: sprintf(time, "%s, %s %d %2d:%02dh",
translator::get_month_name(month%12),
translator::translate(seasons[wl->get_jahreszeit()]),
year,
stunden,
minuten
);
break;
// just only season
default: sprintf(time, "%s %d",
translator::translate(seasons[wl->get_jahreszeit()]),
year);
break;
}