From b488ec92727b4ed95f270f85a3a94bf1abab570f Mon Sep 17 00:00:00 2001 From: Yves Rizoud Date: Sat, 18 Oct 2008 19:23:35 +0000 Subject: [PATCH] Fixed stricter compilation warnings, deleted unused asm code git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@288 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- Makefile | 4 +- Makefile.dep | 3 +- aide.c | 4 +- boutons.c | 2 +- clavier.c | 10 +- divers.c | 2 +- gfxcfg.c | 6 +- global.h | 9 +- graph.c | 15 ++- init.c | 14 +-- loadsave.c | 44 ++------ op_asm.c | 279 --------------------------------------------------- op_asm.h | 147 --------------------------- op_c.c | 5 +- op_c.h | 2 +- pages.c | 8 +- readline.c | 2 +- sdlscreen.c | 7 +- sdlscreen.h | 1 - 19 files changed, 49 insertions(+), 515 deletions(-) delete mode 100644 op_asm.c delete mode 100644 op_asm.h diff --git a/Makefile b/Makefile index ca1ca329..b5cd74dc 100644 --- a/Makefile +++ b/Makefile @@ -24,7 +24,7 @@ ifdef COMSPEC DELCOMMAND = del BIN = grafx2.exe CFGBIN = gfxcfg.exe - COPT = -Wall -O -g -ggdb `sdl-config --cflags` + COPT = -W -Wall -O -g -ggdb `sdl-config --cflags` LOPT = `sdl-config --libs` CC = gcc else @@ -50,7 +50,7 @@ endif OBJ = main.o init.o graph.o sdlscreen.o divers.o special.o boutons.o palette.o \ aide.o operatio.o pages.o loadsave.o readline.o moteur.o files.o op_c.o \ - linux.o op_asm.o readini.o saveini.o shade.o clavier.o io.o version.o + linux.o readini.o saveini.o shade.o clavier.o io.o version.o CFGOBJ = gfxcfg.o SFont.o clavier.o io.o OBJDIR = obj/ diff --git a/Makefile.dep b/Makefile.dep index 826ab25e..70f4cd94 100644 --- a/Makefile.dep +++ b/Makefile.dep @@ -30,9 +30,8 @@ moteur.o: moteur.c const.h struct.h global.h loadsave.h graph.h divers.h \ special.h boutons.h operatio.h shade.h erreurs.h linux.h sdlscreen.h files.o: files.c const.h struct.h global.h loadsave.h graph.h divers.h \ erreurs.h linux.h -op_c.o: op_c.c op_c.h struct.h const.h op_asm.h erreurs.h +op_c.o: op_c.c op_c.h struct.h const.h erreurs.h linux.o: linux.c -op_asm.o: op_asm.c op_c.h struct.h const.h graph.h readini.o: readini.c const.h global.h struct.h loadsave.h graph.h saveini.o: saveini.c const.h global.h struct.h loadsave.h readini.h \ files.h erreurs.h graph.h diff --git a/aide.c b/aide.c index a94fcf05..14a17c50 100644 --- a/aide.c +++ b/aide.c @@ -67,7 +67,7 @@ void Afficher_aide(void) short Largeur; // Largeur physique d'une ligne de texte char TypeLigne; // N: Normale, T: Titre, S: Sous-titre // -: Ligne inférieur de sous-titre - const unsigned char * Ligne; + const char * Ligne; Pos_Reel_X=Fenetre_Pos_X+(13*Menu_Facteur_X); Pos_Reel_Y=Fenetre_Pos_Y+(19*Menu_Facteur_Y); @@ -391,7 +391,7 @@ void Bouton_Stats(void) // Affichage du nombre de couleur utilisé Print_dans_fenetre(18,91,"Colors used:",STATS_COULEUR_TITRES,CM_Noir); - bzero(Utilisation_couleur,256*sizeof(Utilisation_couleur[0])); + memset(Utilisation_couleur,0,sizeof(Utilisation_couleur)); sprintf(Buffer,"%d",Palette_Compter_nb_couleurs_utilisees(Utilisation_couleur)); Print_dans_fenetre(122,91,Buffer,STATS_COULEUR_DONNEES,CM_Noir); diff --git a/boutons.c b/boutons.c index c9739337..699db20e 100644 --- a/boutons.c +++ b/boutons.c @@ -331,7 +331,7 @@ void Bouton_Choix_backcolor(void) //---------------------- Cacher ou réafficher le menu ------------------------ -void Pixel_dans_barre_d_outil_cachee(word X,word Y,byte Couleur) +void Pixel_dans_barre_d_outil_cachee(__attribute__((unused)) word X,__attribute__((unused)) word Y,__attribute__((unused)) byte Couleur) { // C'est fait exprès que ce soit vide... // C'est parce que y'a rien du tout à afficher vu que la barre d'outil est diff --git a/clavier.c b/clavier.c index 289cd8e1..27bbe168 100644 --- a/clavier.c +++ b/clavier.c @@ -320,9 +320,9 @@ word Conversion_Touche(SDL_keysym Sym) // seront codées sur 11 bits, le 12e bit est mis à 1 (0x0800) if (Sym.sym != 0) Retour = Sym.sym; - else if (Sym.scancode != 0) - { - Retour = (Sym.scancode & 0x07FF) | 0x0800; + else if (Sym.scancode != 0) + { + Retour = (Sym.scancode & 0x07FF) | 0x0800; } if (Sym.mod & (KMOD_LSHIFT | KMOD_RSHIFT)) @@ -331,7 +331,7 @@ word Conversion_Touche(SDL_keysym Sym) Retour |= MOD_CTRL; if (Sym.mod & (KMOD_LALT | KMOD_RALT | KMOD_MODE)) Retour |= MOD_ALT; - return Retour; + return Retour; } const char * Nom_touche(word Touche) @@ -447,7 +447,7 @@ const char * Nom_touche(word Touche) } // Touches au libellé connu - for (Indice=0; Indice < sizeof(Table_touches)/sizeof(S_Libelle_touche);Indice++) + for (Indice=0; Indice < (long)sizeof(Table_touches)/(long)sizeof(S_Libelle_touche);Indice++) { if (Touche == Table_touches[Indice].Sym) { diff --git a/divers.c b/divers.c index 28b3de47..016e6c57 100644 --- a/divers.c +++ b/divers.c @@ -135,7 +135,7 @@ void Effacer_image_courante(byte Couleur) ); } -void Sensibilite_souris(word X,word Y) +void Sensibilite_souris(__attribute__((unused)) word X,__attribute__((unused)) word Y) { puts("Sensibilite_souris non implémenté!"); } diff --git a/gfxcfg.c b/gfxcfg.c index af34a737..ba9e8c37 100644 --- a/gfxcfg.c +++ b/gfxcfg.c @@ -239,9 +239,9 @@ char * Interpretation_du_fichier_config() // Si la config contenait des touches, on les initialise: if (Chunk[CHUNK_TOUCHES].Taille) { - int Indice_config; + unsigned int Indice_config; Ptr = ChunkData[CHUNK_TOUCHES]; - for (Indice_config=0; Indice_config< Chunk[CHUNK_TOUCHES].Taille / sizeof(struct Config_Infos_touche) ; Indice_config++) + for (Indice_config=0; Indice_config=Limite_Gauche) && (Pos_X<=Limite_Droite) && @@ -4172,7 +4171,7 @@ void Remplir(byte Couleur_de_remplissage) } // Effacement d'un point de preview - void Pixel_figure_Effacer_preview(word Pos_X,word Pos_Y,byte Couleur) + void Pixel_figure_Effacer_preview(word Pos_X,word Pos_Y,__attribute__((unused)) byte Couleur) { if ( (Pos_X>=Limite_Gauche) && (Pos_X<=Limite_Droite) && diff --git a/init.c b/init.c index 3d987d53..9c4cb786 100644 --- a/init.c +++ b/init.c @@ -72,7 +72,7 @@ void Chercher_repertoire_du_programme(char * Chaine) } // Ajouter un lecteur à la liste de lecteurs -void Ajouter_lecteur(byte Numero, char Lettre, byte Type) +void Ajouter_lecteur(char Lettre, byte Type) { Drive[Nb_drives].Lettre=Lettre; Drive[Nb_drives].Type =Type; @@ -89,8 +89,8 @@ void Rechercher_drives(void) //Sous linux, il n'y a pas de lecteurs, on va juste mettre // un disque dur qui pointera vers la racine, // et un autre vers le home directory de l'utilisateur. - Ajouter_lecteur(0,'/', LECTEUR_HDD); - Ajouter_lecteur(1,'~', LECTEUR_HDD); + Ajouter_lecteur('/', LECTEUR_HDD); + Ajouter_lecteur('~', LECTEUR_HDD); #else int DriveBits = GetLogicalDrives(); int IndiceLecteur; @@ -125,7 +125,7 @@ void Rechercher_drives(void) TypeLecteur=LECTEUR_NETWORK; break; } - Ajouter_lecteur(IndiceBit, 'A'+IndiceBit, TypeLecteur); + Ajouter_lecteur('A'+IndiceBit, TypeLecteur); IndiceLecteur++; } } @@ -1591,7 +1591,7 @@ int Charger_CFG(int Tout_charger) if ((Handle=fopen(Nom_du_fichier,"rb"))==NULL) return ERREUR_CFG_ABSENT; - if ( (Taille_fichier0) Erreur(0); @@ -1658,7 +1628,7 @@ void Load_LBM(void) read_dword_be(LBM_Fichier,&Nb_couleurs); Nb_couleurs/=3; - if (((int)1<sizeof(T_CEL_Header1)) - && ( (((Header1.Width+1)>>1)*Header1.Height)==(Taille_du_fichier-sizeof(T_CEL_Header1)) ) ) + if ( (Taille_du_fichier>(long int)sizeof(T_CEL_Header1)) + && ( (((Header1.Width+1)>>1)*Header1.Height)==(Taille_du_fichier-(long int)sizeof(T_CEL_Header1)) ) ) { // Chargement d'un fichier CEL sans signature (vieux fichiers) Principal_Largeur_image=Header1.Width; diff --git a/op_asm.c b/op_asm.c deleted file mode 100644 index 59ee8823..00000000 --- a/op_asm.c +++ /dev/null @@ -1,279 +0,0 @@ -/* Grafx2 - The Ultimate 256-color bitmap paint program - - Copyright 2007 Adrien Destugues - Copyright 1996-2001 Sunset Design (Guillaume Dorme & Karl Maritaud) - - Grafx2 is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; version 2 - of the License. - - Grafx2 is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Grafx2; if not, see or - write to the Free Software Foundation, Inc., - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -#include "op_c.h" -#include - -#include "graph.h" - -/************************************************************************************* - * Diffusion d'erreur avec l'algorithme de Floyd-Steinberg pour conversion 24b > 256c - * Pour chaque pixel de la source : - * 1) On fait une recherche dans la palette pour trouver la couleurs plus proche - * 2) On calcule la différence avec la vraie couleur - * 3) On répartit cette différence entre les pixels autours avec les coefs: - * - 7/16 pour le pixel de droite - * - 3/16 pour le pixel en bas à gauche - * - 5/16 pour le pixel en dessous - * - 1/16 pour le pixel en bas à droite - * Cette différence est appliquée directement à la source, et sera prise en compte - * lors du traitement des pixels suivants (on ne touche pas aux pixels qui sont au - * dessus ou à gauche de celui en cours !) - ************************************************************************************/ - -void OPASM_DitherFS_6123( - Bitmap256 Destination, // Pointeur sur le 1er pixel de la ligne - Bitmap24B Source, // Idem mais sur la source - int Largeur, // Largeur à traiter, =(largeur_image-2), (>0) - struct Composantes * Palette, // Palette de l'image destination - byte * TableC, // Table de conversion 24b->8b - byte ReducR, // 8-Nb_bits_rouges - byte ReducV, // 8-Nb_bits_verts - byte ReducB, // 8-Nb_bits_bleus - byte NbbV, // Nb_bits_verts - byte NbbB) // Nb_bits_bleus -{ - byte DSFRouge,DSFVert,DSFBleu=0,DSFRougeAD,DSFVertAD,DSFBleuAD; - int VarA; - Bitmap24B PixelCourant, Cible; - - // Pour chaque pixel sur la largeur - for(VarA=0;VarA8b - DSFRougeAD = PixelCourant->R - ReducR; - DSFVertAD = PixelCourant->V - ReducV; - DSFBleuAD = PixelCourant->B - ReducB; - - *Destination = *(TableC + DSFRougeAD*256*256 + DSFVertAD*256 + DSFBleu); - - // On calcule l'erreur - DSFRouge = PixelCourant->R - Palette[*Destination].R; - DSFVert = PixelCourant->V - Palette[*Destination].V; - DSFBleu = PixelCourant->B - Palette[*Destination].B; - - // On diffuse l'erreur sur le pixel de droite (6) - DSFRougeAD = (DSFRouge*7)/16; - DSFVertAD = (DSFVert*7)/16; - DSFBleuAD = (DSFBleu*7)/16; - - // Diffusion de l'erreur dans la source - Cible = PixelCourant + 1; // "Pixel à droite" - Cible->R = Max(Cible->R + DSFRougeAD,255); - Cible->V = Max(Cible->V + DSFVertAD,255); - Cible->B = Max(Cible->B + DSFBleuAD,255); - - // On diffuse sur le pixel en bas à gauche (1) - DSFRougeAD = (DSFRouge*3)/16; - DSFVertAD = (DSFVert*3)/16; - DSFBleuAD = (DSFBleu*3)/16; - - Cible = PixelCourant + Largeur; // "Pixel en bas à gauche" - Cible->R = Max(Cible->R + DSFRougeAD,255); - Cible->V = Max(Cible->V + DSFVertAD,255); - Cible->B = Max(Cible->B + DSFBleuAD,255); - - // On diffuse sur le pixel en dessous (2) - DSFRougeAD = (DSFRouge*5)/16; - DSFVertAD = (DSFVert*5)/16; - DSFBleuAD = (DSFBleu*5)/16; - - Cible ++; // "Pixel en dessous" - Cible->R = Max(Cible->R + DSFRougeAD,255); - Cible->V = Max(Cible->V + DSFVertAD,255); - Cible->B = Max(Cible->B + DSFBleuAD,255); - - // On diffuse sur le pixel en dessous (2) - DSFRougeAD = (DSFRouge*1)/16; - DSFVertAD = (DSFVert*1)/16; - DSFBleuAD = (DSFBleu*1)/16; - - Cible ++; // "Pixel en bas à droite" - Cible->R = Max(Cible->R + DSFRougeAD,255); - Cible->V = Max(Cible->V + DSFVertAD,255); - Cible->B = Max(Cible->B + DSFBleuAD,255); - - Destination++; - } - -} - -/* Les fonctions ci-dessous servent pour les pixels des bords et des coins, car on ne peut pas les traiter normalement - * (segfault ou dithering sur l'autre bout de l'image) */ - -void OPASM_DitherFS_623( - Bitmap256 Destination, // Pointeur sur le 1er pixel de la ligne - Bitmap24B Source, // Idem mais sur la source - int Largeur, // Largeur à traiter, =(largeur_image-2), (>0) - struct Composantes * Palette, // Palette de l'image destination - byte * TableC, // Table de conversion 24b->8b - byte ReducR, // 8-Nb_bits_rouges - byte ReducV, // 8-Nb_bits_verts - byte ReducB, // 8-Nb_bits_bleus - byte NbbV, // Nb_bits_verts - byte NbbB) // Nb_bits_bleus -{ - puts("OPASM_DitherFS_623 non implémenté!"); -} - -void OPASM_DitherFS_12( - Bitmap256 Destination, // Pointeur sur le 1er pixel de la ligne - Bitmap24B Source, // Idem mais sur la source - int Largeur, // Largeur à traiter, =(largeur_image-2), (>0) - struct Composantes * Palette, // Palette de l'image destination - byte * TableC, // Table de conversion 24b->8b - byte ReducR, // 8-Nb_bits_rouges - byte ReducV, // 8-Nb_bits_verts - byte ReducB, // 8-Nb_bits_bleus - byte NbbV, // Nb_bits_verts - byte NbbB) // Nb_bits_bleus -{ - puts("OPASM_DitherFS_12 non implémenté!"); -} - -void OPASM_DitherFS_6( - Bitmap256 Destination, // Pointeur sur le 1er pixel de la ligne - Bitmap24B Source, // Idem mais sur la source - int Largeur, // Largeur à traiter, =(largeur_image-1), (>0) - struct Composantes * Palette, // Palette de l'image destination - byte * TableC, // Table de conversion 24b->8b - byte ReducR, // 8-Nb_bits_rouges - byte ReducV, // 8-Nb_bits_verts - byte ReducB, // 8-Nb_bits_bleus - byte NbbV, // Nb_bits_verts - byte NbbB) // Nb_bits_bleus -{ - puts("OPASM_DitherFS_6 non implémenté!"); -} - - void OPASM_DitherFS( - Bitmap256 Destination, // Pointeur sur le pixel - Bitmap24B Source, // Idem mais sur la source - byte * TableC, // Table de conversion 24b->8b - byte ReducR, // 8-Nb_bits_rouges - byte ReducV, // 8-Nb_bits_verts - byte ReducB, // 8-Nb_bits_bleus - byte NbbV, // Nb_bits_verts - byte NbbB) // Nb_bits_bleus -{ - puts("OPASM_DitherFS non implémenté!"); -} - -void OPASM_DitherFS_2( - Bitmap256 Destination, // Pointeur sur le 1er pixel de la colonne - Bitmap24B Source, // Idem mais sur la source - int Hauteur, // Hauteur à traiter, =(hauteur_image-1), (>0) - struct Composantes * Palette, // Palette de l'image destination - byte * TableC, // Table de conversion 24b->8b - byte ReducR, // 8-Nb_bits_rouges - byte ReducV, // 8-Nb_bits_verts - byte ReducB, // 8-Nb_bits_bleus - byte NbbV, // Nb_bits_verts - byte NbbB) // Nb_bits_bleus -{ - puts("OPASM_DitherFS_2 non implémenté!"); -} - - void OPASM_Split_cluster_Rouge( - int * tableO, // Table d'occurences - int rmin, // rmin << rdec - int vmin, // vmin << vdec - int bmin, // bmin << bdec - int rmax, // rmax << rdec - int vmax, // vmin << vdec - int bmax, // bmin << bdec - int rinc, // Incrémentation sur les rouges 1 << rdec - int vinc, // Incrémentation sur les verts 1 << vdec - int binc, // Incrémentation sur les bleus 1 << bdec - int limite, // Nombre d'occurences minimales - int rdec, // rdec - int * rouge) // Valeur du rouge atteignant la limite -{ - puts("OPASM_Split_cluster_Rouge non implémenté!"); -} - -void OPASM_Split_cluster_Vert( - int * tableO, // Table d'occurences - int rmin, // rmin << rdec - int vmin, // vmin << vdec - int bmin, // bmin << bdec - int rmax, // rmax << rdec - int vmax, // vmin << vdec - int bmax, // bmin << bdec - int rinc, // Incrémentation sur les rouges 1 << rdec - int vinc, // Incrémentation sur les verts 1 << vdec - int binc, // Incrémentation sur les bleus 1 << bdec - int limite, // Nombre d'occurences minimales - int vdec, // vdec - int * vert) // Valeur du vert atteignant la limite -{ - puts("OPASM_Split_cluster_Vert non implémenté!"); -} - -void OPASM_Split_cluster_Bleu( - int * tableO, // Table d'occurences - int rmin, // rmin << rdec - int vmin, // vmin << vdec - int bmin, // bmin << bdec - int rmax, // rmax << rdec - int vmax, // vmin << vdec - int bmax, // bmin << bdec - int rinc, // Incrémentation sur les rouges 1 << rdec - int vinc, // Incrémentation sur les verts 1 << vdec - int binc, // Incrémentation sur les bleus 1 << bdec - int limite, // Nombre d'occurences minimales - int bdec, // bdec - int * bleu) // Valeur du bleu atteignant la limite -{ - puts("OPASM_Split_cluster_Bleu non implémenté!"); -} - - void OPASM_Compter_occurences( - int * Destination, // Pointeur sur la table d'occurences - Bitmap24B Source, // Pointeur sur l'image - int Taille, // Nombre de pixels dans l'image - byte ReducR, // 8-Nb_bits_rouges - byte ReducV, // 8-Nb_bits_verts - byte ReducB, // 8-Nb_bits_bleus - byte NbbV, // Nb_bits_verts - byte NbbB) // Nb_bits_bleus -{ - puts("OPASM_Compter_occurences non implémenté!"); -} - -void OPASM_Analyser_cluster( - int * TableO, // Table d'occurences - int * rmin, // rmin << rdec - int * vmin, // vmin << vdec - int * bmin, // bmin << bdec - int * rmax, // rmax << rdec - int * vmax, // vmax << vdec - int * bmax, // bmax << bdec - int rdec, // rdec - int vdec, // vdec - int bdec, // bdec - int rinc, // Incrémentation sur les rouges 1 << rdec - int vinc, // Incrémentation sur les verts 1 << vdec - int binc, // Incrémentation sur les bleus 1 << bdec - int * Nbocc) // Nombre d'occurences -{ - puts("OPASM_Analyser_cluster non implémenté!"); -} diff --git a/op_asm.h b/op_asm.h deleted file mode 100644 index 25b37933..00000000 --- a/op_asm.h +++ /dev/null @@ -1,147 +0,0 @@ -#ifndef _OP_ASM_H_ -#define _OP_ASM_H_ - -void OPASM_DitherFS_6123( - Bitmap256 Destination, // Pointeur sur le 1er pixel de la ligne - Bitmap24B Source, // Idem mais sur la source - int Largeur, // Largeur à traiter, =(largeur_image-2), (>0) - struct Composantes * Palette, // Palette de l'image destination - byte * TableC, // Table de conversion 24b->8b - byte ReducR, // 8-Nb_bits_rouges - byte ReducV, // 8-Nb_bits_verts - byte ReducB, // 8-Nb_bits_bleus - byte NbbV, // Nb_bits_verts - byte NbbB); // Nb_bits_bleus - -void OPASM_DitherFS_623( - Bitmap256 Destination, // Pointeur sur le 1er pixel de la ligne - Bitmap24B Source, // Idem mais sur la source - int Largeur, // Largeur à traiter, =(largeur_image-2), (>0) - struct Composantes * Palette, // Palette de l'image destination - byte * TableC, // Table de conversion 24b->8b - byte ReducR, // 8-Nb_bits_rouges - byte ReducV, // 8-Nb_bits_verts - byte ReducB, // 8-Nb_bits_bleus - byte NbbV, // Nb_bits_verts - byte NbbB); // Nb_bits_bleus - -void OPASM_DitherFS_12( - Bitmap256 Destination, // Pointeur sur le 1er pixel de la ligne - Bitmap24B Source, // Idem mais sur la source - int Largeur, // Largeur à traiter, =(largeur_image-2), (>0) - struct Composantes * Palette, // Palette de l'image destination - byte * TableC, // Table de conversion 24b->8b - byte ReducR, // 8-Nb_bits_rouges - byte ReducV, // 8-Nb_bits_verts - byte ReducB, // 8-Nb_bits_bleus - byte NbbV, // Nb_bits_verts - byte NbbB); // Nb_bits_bleus - -void OPASM_DitherFS_6( - Bitmap256 Destination, // Pointeur sur le 1er pixel de la ligne - Bitmap24B Source, // Idem mais sur la source - int Largeur, // Largeur à traiter, =(largeur_image-1), (>0) - struct Composantes * Palette, // Palette de l'image destination - byte * TableC, // Table de conversion 24b->8b - byte ReducR, // 8-Nb_bits_rouges - byte ReducV, // 8-Nb_bits_verts - byte ReducB, // 8-Nb_bits_bleus - byte NbbV, // Nb_bits_verts - byte NbbB); // Nb_bits_bleus - -void OPASM_DitherFS( - Bitmap256 Destination, // Pointeur sur le pixel - Bitmap24B Source, // Idem mais sur la source - byte * TableC, // Table de conversion 24b->8b - byte ReducR, // 8-Nb_bits_rouges - byte ReducV, // 8-Nb_bits_verts - byte ReducB, // 8-Nb_bits_bleus - byte NbbV, // Nb_bits_verts - byte NbbB); // Nb_bits_bleus - -void OPASM_DitherFS_2( - Bitmap256 Destination, // Pointeur sur le 1er pixel de la colonne - Bitmap24B Source, // Idem mais sur la source - int Hauteur, // Hauteur à traiter, =(hauteur_image-1), (>0) - struct Composantes * Palette, // Palette de l'image destination - byte * TableC, // Table de conversion 24b->8b - byte ReducR, // 8-Nb_bits_rouges - byte ReducV, // 8-Nb_bits_verts - byte ReducB, // 8-Nb_bits_bleus - byte NbbV, // Nb_bits_verts - byte NbbB); // Nb_bits_bleus - -void OPASM_Compter_occurences( - int * Destination, // Pointeur sur la table d'occurences - Bitmap24B Source, // Pointeur sur l'image - int Taille, // Nombre de pixels dans l'image - byte ReducR, // 8-Nb_bits_rouges - byte ReducV, // 8-Nb_bits_verts - byte ReducB, // 8-Nb_bits_bleus - byte NbbV, // Nb_bits_verts - byte NbbB); // Nb_bits_bleus - -void OPASM_Analyser_cluster( - int * TableO, // Table d'occurences - int * rmin, // rmin << rdec - int * vmin, // vmin << vdec - int * bmin, // bmin << bdec - int * rmax, // rmax << rdec - int * vmax, // vmax << vdec - int * bmax, // bmax << bdec - int rdec, // rdec - int vdec, // vdec - int bdec, // bdec - int rinc, // Incrémentation sur les rouges 1 << rdec - int vinc, // Incrémentation sur les verts 1 << vdec - int binc, // Incrémentation sur les bleus 1 << bdec - int * Nbocc); // Nombre d'occurences - -void OPASM_Split_cluster_Rouge( - int * tableO, // Table d'occurences - int rmin, // rmin << rdec - int vmin, // vmin << vdec - int bmin, // bmin << bdec - int rmax, // rmax << rdec - int vmax, // vmin << vdec - int bmax, // bmin << bdec - int rinc, // Incrémentation sur les rouges 1 << rdec - int vinc, // Incrémentation sur les verts 1 << vdec - int binc, // Incrémentation sur les bleus 1 << bdec - int limite, // Nombre d'occurences minimales - int rdec, // rdec - int * rouge); // Valeur du rouge atteignant la limite - -void OPASM_Split_cluster_Vert( - int * tableO, // Table d'occurences - int rmin, // rmin << rdec - int vmin, // vmin << vdec - int bmin, // bmin << bdec - int rmax, // rmax << rdec - int vmax, // vmin << vdec - int bmax, // bmin << bdec - int rinc, // Incrémentation sur les rouges 1 << rdec - int vinc, // Incrémentation sur les verts 1 << vdec - int binc, // Incrémentation sur les bleus 1 << bdec - int limite, // Nombre d'occurences minimales - int vdec, // vdec - int * vert); // Valeur du vert atteignant la limite - -void OPASM_Split_cluster_Bleu( - int * tableO, // Table d'occurences - int rmin, // rmin << rdec - int vmin, // vmin << vdec - int bmin, // bmin << bdec - int rmax, // rmax << rdec - int vmax, // vmin << vdec - int bmax, // bmin << bdec - int rinc, // Incrémentation sur les rouges 1 << rdec - int vinc, // Incrémentation sur les verts 1 << vdec - int binc, // Incrémentation sur les bleus 1 << bdec - int limite, // Nombre d'occurences minimales - int bdec, // bdec - int * bleu); // Valeur du bleu atteignant la limite - - - -#endif diff --git a/op_c.c b/op_c.c index 26e368e8..f52de46e 100644 --- a/op_c.c +++ b/op_c.c @@ -25,7 +25,6 @@ #include #include #include "op_c.h" -#include "op_asm.h" #include "erreurs.h" #undef OPTIMISATIONS_ASSEMBLEUR @@ -790,7 +789,7 @@ void CS_Trier_par_luminance(ClusterSet * cs) cs->clusters=nc; } -void CS_Generer_TC_et_Palette(ClusterSet * cs,Table_occurence * to,Table_conversion * tc,struct Composantes * palette) +void CS_Generer_TC_et_Palette(ClusterSet * cs,Table_conversion * tc,struct Composantes * palette) { int indice; int r,v,b; @@ -957,7 +956,7 @@ Table_conversion * Optimiser_palette(Bitmap24B image,int taille,struct Composant CS_Trier_par_chrominance(cs); // Enfin on génère la palette et la table de correspondance entre chaque couleur 24b et sa couleur palette associée. - CS_Generer_TC_et_Palette(cs,to,tc,palette); + CS_Generer_TC_et_Palette(cs,tc,palette); CS_Delete(cs); TO_Delete(to); diff --git a/op_c.h b/op_c.h index 73dad09f..5e374cbd 100644 --- a/op_c.h +++ b/op_c.h @@ -184,7 +184,7 @@ void CS_Get(ClusterSet * cs,Cluster * c); void CS_Set(ClusterSet * cs,Cluster * c); void CS_Generer(ClusterSet * cs,Table_occurence * to); void CS_Calculer_teintes(ClusterSet * cs,Table_occurence * to); -void CS_Generer_TC_et_Palette(ClusterSet * cs,Table_occurence * to,Table_conversion * tc,struct Composantes * palette); +void CS_Generer_TC_et_Palette(ClusterSet * cs,Table_conversion * tc,struct Composantes * palette); diff --git a/pages.c b/pages.c index 6f9bff3d..d76642e8 100644 --- a/pages.c +++ b/pages.c @@ -511,7 +511,7 @@ void Creer_nouvelle_page(S_Page * Nouvelle_page,S_Liste_de_pages * Liste_courant ( (Liste_courante->Taille_liste==Liste_courante->Nb_pages_allouees) // ou qu'il ne reste plus assez de place pour allouer la Nouvelle_page || ( (Memoire_libre()-QUANTITE_MINIMALE_DE_MEMOIRE_A_CONSERVER)< - (Nouvelle_page->Hauteur*Nouvelle_page->Largeur) ) ); + (unsigned long)(Nouvelle_page->Hauteur*Nouvelle_page->Largeur) ) ); if (!Il_faut_liberer) { @@ -578,7 +578,7 @@ void Creer_nouvelle_page(S_Page * Nouvelle_page,S_Liste_de_pages * Liste_courant // On regarde s'il faut continuer à libérer de la place Il_faut_liberer=(Memoire_libre()-QUANTITE_MINIMALE_DE_MEMOIRE_A_CONSERVER) - <(Nouvelle_page->Hauteur*Nouvelle_page->Largeur); + <(unsigned long)(Nouvelle_page->Hauteur*Nouvelle_page->Largeur); // S'il ne faut pas, c'est qu'on peut allouer un bitmap // pour la Nouvelle_page @@ -990,7 +990,7 @@ void * Emprunter_memoire_de_page(int taille) { // On regarde s'il faut libérer des pages: Il_faut_liberer= - (Memoire_libre()-QUANTITE_MINIMALE_DE_MEMOIRE_A_CONSERVER)