[Olsr-cvs] olsrd-current/src/unix misc.c,1.5,1.6

Bernd Petrovitsch (spam-protected)
Thu Aug 2 23:58:45 CEST 2007


Update of /cvsroot/olsrd/olsrd-current/src/unix
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv2525/src/unix

Modified Files:
	misc.c 
Log Message:
* pave the way to add -Wshadow
* save an int in the data segment


Index: misc.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/unix/misc.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** misc.c	10 Mar 2005 07:01:48 -0000	1.5
--- misc.c	2 Aug 2007 21:58:43 -0000	1.6
***************
*** 48,75 ****
  void clear_console(void)
  {
!   FILE *pipe;
!   static int first_time = 1;
    static char clear_buff[100];
-   static olsr_u16_t len = 0;
-   int c;
    int i;
  
!   if (first_time != 0)
      {
!       first_time = 0;
! 
!       pipe = popen("clear", "r");
! 
!       for (len = 0; len < sizeof (clear_buff); len++)
          {
!           c = fgetc(pipe);
! 
            if (c == EOF)
              break;
  
!           clear_buff[len] = (char)c;
          }
  
!       pclose(pipe);
      }
  
--- 48,68 ----
  void clear_console(void)
  {
!   static int len = -1;
    static char clear_buff[100];
    int i;
  
!   if (len < 0)
      {
!       FILE *pip = popen("clear", "r");
!       for (len = 0; len < (int)sizeof(clear_buff); len++)
          {
!           int c = fgetc(pip);
            if (c == EOF)
              break;
  
!           clear_buff[len] = c;
          }
  
!       pclose(pip);
      }
  





More information about the Olsr-cvs mailing list