de-lint. disable c++ parentheses warnings. fix casts in AROSPDFApp.cc
[AROS-Contrib.git] / rexx / lstring / x2d.c
blobc64f8aab4ee68395ea409522618cb2fb006f6853
1 /*
2 * $Header$
3 * $Log$
4 * Revision 1.1 2001/04/04 05:43:38 wang
5 * First commit: compiles on Linux, Amiga, Windows, Windows CE, generic gcc
7 * Revision 1.1 1998/07/02 17:20:58 bnv
8 * Initial Version
12 #include <lstring.h>
14 /* ------------------ Lx2d ------------------- */
15 void
16 Lx2d( const PLstr to, const PLstr from, long n )
18 Lstr tmp;
19 int sign;
21 LINITSTR(tmp);
23 if (n<=0) {
24 Lx2c(&tmp,from);
25 Lc2d(to,&tmp,0);
26 } else {
27 if (n>8) n=8;
28 Lspace(&tmp,from,0,' ');
29 Lright(to,&tmp,n,'0');
30 sign = HEXVAL(LSTR(*to)[0]) & 0x8;
31 Lx2c(&tmp,to);
32 Lc2d(to,&tmp,0);
33 if (sign) {
34 if (n==sizeof(long)*2)
35 LINT(*to) = -(~LINT(*to) + 1);
36 else
37 LINT(*to) = LINT(*to) - (1L << (n*4));
41 /****
42 if ((LLEN(*to)&1) && LSTR(*to)[0]>'7') {
43 Lright(&tmp,to,LLEN(*to)+1,'f');
44 Lstrcpy(to,&tmp);
46 Lx2c(&tmp,to);
47 Lc2d(to,&tmp,n/2);
48 ****/
50 LFREESTR(tmp);
51 } /* Lx2d */