Hi!

11-Июн-2006 02:47 [EMAIL PROTECTED] (Blair Campbell) wrote to
[EMAIL PROTECTED]:

BC> +++ goxy.c  11 Jun 2006 02:47:05 -0000      1.3
BC> -   regs.h.dh = y - 1;
BC> -   regs.h.dl = x - 1;
BC> -   int86(0x10, &regs, &regs);
BC> +   regs.r_ax = 0x0200;                /* set cursor position */
BC> +   regs.r_dx = ( ( y - 1 ) & 0xFF ) | ( ( x - 1 ) >> 8 );

      Bug! Should be replaced by

regs.r_dx = (((y-1) & 0xFF) << 8) | ((x-1) & 0xFF);

But much better (much more size efficient) to revert back to int86().

BC> +    _AH = 0x02;
BC> +    _DH = ( y - 1 );
BC> +    _DL = ( x - 1 );
BC> +    _BX = 0;
BC> +    geninterrupt( 0x10 );

      This adds more incompatibility and prevents (future) porting to OW.  :(

BC> +++ mk_rddir.c      11 Jun 2006 02:47:05 -0000      1.5
BC> @@ -17,22 +17,32 @@
BC>  int lfn_mrc_dir(const char *path, int func)
BC> -   if (checkDriveSupportsLFN(getdisk() + 'A'))
BC> -        func = (func >> 8) + 0x7100;
BC> -   r.r_ax = func;
BC> +    r.r_ax = 0x7100 | func;

      (1)

BC> +    r.r_dx = FP_OFF( path );
BC>     r.r_ds = FP_SEG(path);
BC> +    r.r_flags = 1;
BC> +    intr( 0x21, &r );

      Again bug: you have no ways to pass _your_ Carry flag value into
interrupt through int*() functions.

BC> +    return( ( r.r_flags & 1 ) ? -1 : 0 );

      This is same, as "return -(r.r_flags & 1);"

BC> +#define mkdir(x) lfn_mrc_dir(x,0x39)

      (2) Why not use explicitly 0x7139 and thus simplify (1)?

BC> +#ifdef FEATURE_LONG_FILENAMES
BC> +int mk_rd_dir( char *param, int lfnfunc, char *fctname )
BC> +        if((rv = lfn_mrc_dir( argv[0], lfnfunc )) != 0)

      Same here.

BC> +++ timeset.c       11 Jun 2006 02:47:05 -0000      1.3
BC> -  r.h.ch = t->hour;
BC> -  r.h.cl = t->minute;
BC> +  r.r_cx = t->hour | t->minute;

      Wrong replacement!

BC> -  r.h.dh = t->second;
BC> -  r.h.dl = t->hsecond;
BC> +  r.r_dx = t->second | t->hsecond;

      Wrong replacement!

BC> +++ prprompt.c      11 Jun 2006 02:47:05 -0000      1.4
BC>  #include <stdio.h>
BC> +#undef putchar

      This is bad action and not recommended by standard. Especially, you
change prototype (your putchar() expects pointer instead character)!

BC> +++ keyprsd.c       11 Jun 2006 02:47:05 -0000      1.3
BC> +  if (r.r_flags & 0x40)
BC>      return 0;
BC>    else
BC>      return 1;

return (r.r_flags & Zero_FLAG) == 0;

BC> +++ cd_dir.c        11 Jun 2006 02:47:05 -0000      1.7
BC> +int _Cdecl lfn_mrc_dir( const char *name, int function );

      Bug! In mk_rddir.c there is not same prototype!

BC> +++ vcgetch.c       11 Jun 2006 02:47:05 -0000      1.3
BC> +   char ch[ 1 ];
BC> +   ch[ 0 ] = cgetchar();
BC> +    write( 1, isprint(ch[ 0 ]) ? ch : " ", 1 );
BC> +    write( 1, "\b", 1 );

static char ch2 [2] = " \b";
unsigned char ch = cgetchar();
if (!isprint (ch)) ch = ' ';
ch2 [0] = ch;
write (1, ch2, 2);

BC>     fflush(stdout);

      Same bug: mixing FILE* and handle-oriented IO and placing write()
before fflush().

BC> +++ farread.c       11 Jun 2006 02:47:05 -0000      1.3
BC> +unsigned DOSreadwrite(int fd, void far *buffer, unsigned size,
BC> +                      unsigned short func );

      Prototypes should be present _in one place_ (somewhere in headers)!

BC> +++ cmdinput.c      11 Jun 2006 02:47:05 -0000      1.6
BC>  static void outc(char c)
BC>  {
BC> -   putchar(c);
BC> +// putchar(c);
BC> +   write( 1, &c, 1 );

      Wow! Why in so many places use write(), whereas there is defined
outc()?!


_______________________________________________
Freedos-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freedos-devel

Reply via email to