Mercurial > hg > forks > pwpunix
diff pwplib/attrconv.c @ 55:77f40a3c0095
Cleanups.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 27 May 2010 20:16:08 +0300 |
parents | acb5694e93d9 |
children | 5d819ba6891c |
line wrap: on
line diff
--- a/pwplib/attrconv.c Wed May 26 01:22:51 2010 +0300 +++ b/pwplib/attrconv.c Thu May 27 20:16:08 2010 +0300 @@ -1,7 +1,6 @@ #include <stdio.h> #include <stdlib.h> -#include "pwplib.h" #include "convert.h" /* @@ -9,10 +8,9 @@ * */ -void convcalc_1to12() /* &1 == ibm2ibm, */ +void convcalc_1to12(void) /* &1 == ibm2ibm, */ { - u8 tabsrc[]= - { + static const u8 tabsrc[] = { '\"', '\"',' ', '/', '|','/', '\'', '\'',' ', @@ -64,14 +62,11 @@ 223, 219, 32, 0 }; - u8*t=tabsrc; - - int i=0; + const u8 *t = tabsrc; + int i; - for(;i<256;i++) - { + for(i = 0;i<256;i++) pwpconv.tab1to12[i]=BYTES2(pwpconv.font[i],32); - } while(*t) { @@ -80,7 +75,7 @@ } } -void conv_1to12(u8*d,u8*s,int w,int h) +static void conv_1to12(u8*d,u8*s,int w,int h) { w<<=1; for(;h;h--) @@ -111,7 +106,7 @@ * purely font/charset related */ -void convcalc_ascii() +void convcalc_ascii(int x) { memcpy(pwpconv.font, /*00*/ " OOwoxAoooo6qrn*" @@ -132,7 +127,7 @@ /*F0*/ "=+><|J%~o-.Vn2o ",256*sizeof(char)); } -void convcalc_termsafe() +void convcalc_termsafe(void) { int i=256;u8*s=pwpconv.font; for(;i;i--) @@ -151,12 +146,12 @@ memset(pwpconv.col,(parms&1)?0x00:0x07,256*sizeof(u8)); } -void convcalc_monotab_attr(int parms) +static void convcalc_monotab_attr(int parms) { u8 attrmo[2][2]= /* &1: 0=ansicol_dump, 1=vt_dump */ { - 0x00,0x01, - 0x07,0x70 + { 0x00,0x01 }, + { 0x07,0x70 } }; const char intens[16]= @@ -289,7 +284,7 @@ /*******************************/ -void conv_dump_ibm_megatab() +void conv_dump_ibm_megatab(void) { TEMPMALL(u16,tmp,pwplib.videobuf.height*pwplib.videobuf.width*2), *s=(u16*)pwplib.videobuf.d,*d=tmp; @@ -306,7 +301,7 @@ TEMPFREE(tmp); } -void conv_fromibm_double() +static void conv_fromibm_double(void) { int lgt=pwplib.videobuf.width*pwplib.videobuf.height; @@ -314,7 +309,7 @@ conv_1to12(tmp,pwplib.videobuf.d,pwplib.videobuf.width,pwplib.videobuf.height); - {char*save=pwplib.videobuf.d; + {u8 *save=pwplib.videobuf.d; pwplib.videobuf.d=tmp; pwplib.videobuf.height<<=1; conv_dump_ibm_megatab(); @@ -325,7 +320,7 @@ TEMPFREE(tmp); } -void conv_fromibm_half() +static void conv_fromibm_half(void) { TEMPMALL(u8,tmp,pwplib.videobuf.width*pwplib.videobuf.height), *d=tmp,*s=pwplib.videobuf.d; @@ -346,7 +341,7 @@ s+=w; } - {char*save=pwplib.videobuf.d; + {u8 *save=pwplib.videobuf.d; pwplib.videobuf.d=tmp; pwplib.videobuf.height>>=1; conv_dump_ibm_megatab(); @@ -359,7 +354,7 @@ } /* dump_ibm_halved, dump_ibm_realsize */ -void conv_dump_ibm() +void conv_dump_ibm(void) { if(pwplib.setup[SETUP_HALVE]) {