Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 4263 → Rev 4327

/branches/network/uspace/app/tetris/scores.c
117,7 → 117,8
*/
static void copyhiscore(int dest, int src)
{
strcpy(scores[dest].hs_name, scores[src].hs_name);
str_cpy(scores[dest].hs_name, STR_BOUNDS(MAXLOGNAME) + 1,
scores[src].hs_name);
scores[dest].hs_score = scores[src].hs_score;
scores[dest].hs_level = scores[src].hs_level;
}
131,7 → 132,8
clear_screen();
moveto(10 , 10);
puts("Insert your name: ");
strncpy(scores[NUMSPOTS - 1].hs_name, "Player", MAXLOGNAME);
str_cpy(scores[NUMSPOTS - 1].hs_name, STR_BOUNDS(MAXLOGNAME) + 1,
"Player");
i = 6; off = 6;
 
moveto(10 , 28);
195,7 → 197,7
{
int i;
for(i = 0; i < NUMSPOTS; i++) {
strncpy(scores[i].hs_name, "HelenOS Team", MAXLOGNAME);
str_cpy(scores[i].hs_name, STR_BOUNDS(MAXLOGNAME) + 1, "HelenOS Team");
scores[i].hs_score = (NUMSPOTS - i) * 200;
scores[i].hs_level = (i + 1 > MAXLEVEL?MAXLEVEL:i + 1);
}
289,7 → 291,7
/* change = 0; */
/* me = thisuser(); */
/* for (i = 0, sp = &scores[0]; i < nscores; i++, sp++) { */
/* if (sp->hs_level != level || strcmp(sp->hs_name, me) != 0) */
/* if (sp->hs_level != level || str_cmp(sp->hs_name, me) != 0) */
/* continue; */
/* if (score > sp->hs_score) { */
/* (void)printf("%s bettered %s %d score of %d!\n", */
417,7 → 419,7
/* * This is O(n^2), but do you think we care? */
/* *\/ */
/* for (j = 0, pu = count; j < numnames; j++, pu++) */
/* if (strcmp(sp->hs_name, pu->name) == 0) */
/* if (str_cmp(sp->hs_name, pu->name) == 0) */
/* break; */
/* if (j == numnames) { */
/* /\* */
554,7 → 556,7
/* if (me != NULL && */
/* sp->hs_level == level && */
/* sp->hs_score == score && */
/* strcmp(sp->hs_name, me) == 0) { */
/* str_cmp(sp->hs_name, me) == 0) { */
/* putpad(SOstr); */
/* highlight = 1; */
/* } */
/branches/network/uspace/app/tetris/input.c
115,7 → 115,7
if (!lastchar) {
again:
if (!getchar_inprog) {
cons_phone = console_phone_get(true);
cons_phone = console_open(true);
getchar_inprog = async_send_2(cons_phone,
CONSOLE_GETKEY, 0, 0, &charcall);
}
/branches/network/uspace/app/tetris/screen.c
280,7 → 280,7
scr_msg(char *s, int set)
{
int l = strlen(s);
int l = str_size(s);
moveto(Rows - 2, ((Cols - l) >> 1) - 1);
if (set)
/branches/network/uspace/app/tetris/tetris.c
277,7 → 277,7
/* classic = 1; */
/* break; */
/* case 'k': */
/* if (strlen(keys = optarg) != 6) */
/* if (str_size(keys = optarg) != 6) */
/* usage(); */
/* break; */
/* case 'l': */
311,7 → 311,7
errx(1, "duplicate command keys specified.");
}
if (keys[i] == ' ')
strncpy(key_write[i], "<space>", sizeof key_write[i]);
str_cpy(key_write[i], sizeof key_write[i], "<space>");
else {
key_write[i][0] = keys[i];
key_write[i][1] = '\0';