From owner-freebsd-hackers Sun Nov 17 05:52:41 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id FAA19328 for hackers-outgoing; Sun, 17 Nov 1996 05:52:41 -0800 (PST) Received: from frmug.org (frmug-gw.frmug.org [193.56.58.252]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id FAA19321 for ; Sun, 17 Nov 1996 05:52:37 -0800 (PST) Received: (from uucp@localhost) by frmug.org (8.8.2/8.8.2/frmug-1.2) with UUCP id OAA12071 for hackers@FreeBSD.org; Sun, 17 Nov 1996 14:52:30 +0100 (MET) Received: from localhost (localhost [127.0.0.1]) by xp11.frmug.org (8.8.2/8.7.3/xp11-uucp-1.1) with ESMTP id NAA18383 for ; Sun, 17 Nov 1996 13:05:37 +0100 (MET) Message-Id: <199611171205.NAA18383@xp11.frmug.org> To: hackers@FreeBSD.org Subject: syncronizing release numbers Date: Sun, 17 Nov 1996 13:05:37 +0100 From: "Philippe Charnier" Sender: owner-hackers@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk Hello, >jkh 96/11/11 06:18:41 > > Modified: lkm/syscons/snake snake_saver.c > Log: > Make snake 3.0-CURRENT here. > > There's gotta be a better way of syncronizing our release numbers. :-) What about this: Index: snake_saver.c =================================================================== RCS file: /home2h/FreeBSD.cvsroot/src/lkm/syscons/snake/snake_saver.c,v retrieving revision 1.11 diff -u -r1.11 snake_saver.c --- snake_saver.c 1996/11/11 14:18:40 1.11 +++ snake_saver.c 1996/11/17 11:56:48 @@ -35,6 +35,7 @@ #include #include #include +#include #include @@ -45,16 +46,26 @@ void (*current_saver)(int blank); void (*old_saver)(int blank); +#define SAVES_LEN 30 /* "FreeBSD-X.X-XXXXXX-SNAP" is 23 */ + static void snake_saver(int blank) { - const char saves[] = {"FreeBSD-3.0-CURRENT"}; - static u_char *savs[sizeof(saves)-1]; + static char saves[SAVES_LEN + 1]; + static u_char *savs[SAVES_LEN]; static int dirx, diry; + static int saves_len = 0; int f; scr_stat *scp = cur_console; if (blank) { + if (!saves_len) { + strcpy(saves, ostype); + strcat(saves, "-"); + strcat(saves, osrelease); + saves_len = strlen(saves); + } + if (!scrn_blanked) { fillw((FG_LIGHTGREY|BG_BLACK)<<8 | scr_map[0x20], Crtat, scp->xsize * scp->ysize); @@ -62,7 +73,7 @@ dirx = (scp->xpos ? 1 : -1); diry = (scp->ypos ? scp->xsize : -scp->xsize); - for (f=0; f< sizeof(saves)-1; f++) + for (f=0; f< saves_len; f++) savs[f] = (u_char *)Crtat + 2 * (scp->xpos+scp->ypos*scp->xsize); *(savs[0]) = scr_map[*saves]; @@ -76,8 +87,8 @@ if (scrn_blanked++ < 4) return; scrn_blanked = 1; - *(savs[sizeof(saves)-2]) = scr_map[0x20]; - for (f=sizeof(saves)-2; f > 0; f--) + *(savs[saves_len - 1]) = scr_map[0x20]; + for (f=saves_len - 1; f > 0; f--) savs[f] = savs[f-1]; f = (savs[0] - (u_char *)Crtat) / 2; if ((f % scp->xsize) == 0 || @@ -89,7 +100,7 @@ (random() % 20) == 0) diry = -diry; savs[0] += 2*dirx + 2*diry; - for (f=sizeof(saves)-2; f>=0; f--) + for (f=saves_len - 1; f>=0; f--) *(savs[f]) = scr_map[saves[f]]; } else { ------ ------ Philippe Charnier charnier@lirmm.fr (smtp) charnier@xp11.frmug.org (uucp) ``a PC not running FreeBSD is like a venusian with no tentacles'' ------------------------------------------------------------------------