fix many warnings (hope everything will work)

This commit is contained in:
Ondřej Novák 2025-01-27 11:26:51 +01:00
parent cddb569580
commit 858c4384e8
57 changed files with 911 additions and 807 deletions

View file

@ -13,6 +13,7 @@
#include "bgraph.h"
#include "gui.h"
#include "basicobj.h"
#include <stdarg.h>
#define MEMTEXT "Pam<61>t: "
@ -233,7 +234,7 @@ void draw_status_line(char *c)
p=strchr(c,'\0');
*(--p)='\0';
if (p=c) break;
if (p==c) break;
}
position(5,y);outtext(c);
ukaz_mysku();
@ -263,7 +264,7 @@ void status_line(EVENT_MSG *msg, T_EVENT_ROOT **user_data) {
static char st_line[256], oldline[256] = { "\0" };
static char recurse = 1;
if (msg->msg == E_INIT)
if (msg->msg == E_INIT) {
if (recurse) {
T_EVENT_ROOT *p;
recurse = 0;
@ -274,8 +275,10 @@ void status_line(EVENT_MSG *msg, T_EVENT_ROOT **user_data) {
draw_status_line(NULL);
recurse = 1;
return;
} else
} else {
return;
}
}
msg->msg = va_arg(msg->data, int);
if (msg->msg == E_REDRAW) {
@ -364,23 +367,21 @@ void win_label_move(EVENT_MSG *msg,OBJREC *o)
static int drawed=0;
o;
if (msg->msg==E_INIT) return;
if (msg->msg==E_TIMER)
{
send_message(E_TIMER);
if (!drawed)
if (!moved)
{
drawed=1;
redraw_desktop();
moved=0;
}
else
{
drawed=0;
moved=0;
}
}
if (msg->msg == E_INIT)
return;
if (msg->msg == E_TIMER) {
send_message(E_TIMER);
if (!drawed) {
if (!moved) {
drawed = 1;
redraw_desktop();
moved = 0;
} else {
drawed = 0;
moved = 0;
}
}
}
if (msg->msg==E_MOUSE)
{
ms=get_mouse(msg);
@ -447,7 +448,7 @@ void check_box_draw(int x1,int y1, int x2, int y2,OBJREC *o)
{
int x3;
x1+=1;y1+=1;x2-=1;y2-=1;
x1+=1;y1+=1;/*x2-=1*/;y2-=1;
x3=x1+(y2-y1);
draw_border(x1,y1,x3-x1,y2-y1,def_border(4,curcolor));
bar32(x1,y1,x3,y2);
@ -710,18 +711,21 @@ void input_line_draw(int x1,int y1, int x2, int y2, OBJREC *o)
void input_line_event(EVENT_MSG *msg,OBJREC *o)
{
static int cursor=0;
int *len,*start,slen;
int len;
int *start;
int slen;
char *c;
static char *save;
static char clear_kontext;
input_line_state *st = o->userptr;
len = st->len;
start=&st->start;
c=(char *)o->data;
slen=strlen(c);
switch (msg->msg)
{
case E_GET_FOCUS:cursor=0;save=(char *)getmem(*len+1);
case E_GET_FOCUS:cursor=0;save=(char *)getmem(len+1);
strcpy(save,c);clear_kontext=1;break;
case E_LOST_FOCUS:cursor=0;*start=0;free(save);redraw_object(o);break;
case E_CURSOR_TICK:
@ -789,7 +793,7 @@ void input_line_event(EVENT_MSG *msg,OBJREC *o)
case 0:break;
case 13:break;
case 27:strcpy(c,save);slen=strlen(c);if (cursor>slen) cursor=slen;break;
default:if (key>=' ') if (slen<*len || clear_kontext)
default:if (key>=' ') if (slen<len || clear_kontext)
{
int i;
@ -895,13 +899,15 @@ void scroll_button_event(EVENT_MSG *msg,OBJREC *o)
}
}
}
if (msg->msg==E_TIMER && *(char *)o->data )
if (ms_last_event.tl1) set_change();
else if (!ms_last_event.tl2)
if (msg->msg==E_TIMER && *(char *)o->data ) {
if (ms_last_event.tl1) {
set_change();
} else if (!ms_last_event.tl2)
{
*(char *)o->data=0;
redraw_object(o);
}
}
if (msg->msg==E_GET_FOCUS || msg->msg==E_LOST_FOCUS)
{
@ -1258,7 +1264,7 @@ void resizer_event(EVENT_MSG *msg,OBJREC *o)
o;
if (msg->msg==E_INIT) return;
if (msg->msg==E_TIMER && !drawed)
if (msg->msg==E_TIMER && !drawed) {
if (!moved)
{
drawed=1;
@ -1270,6 +1276,7 @@ void resizer_event(EVENT_MSG *msg,OBJREC *o)
drawed=0;
moved=0;
}
}
if (msg->msg==E_MOUSE)
{
ms=get_mouse(msg);

View file

@ -29,7 +29,7 @@ void label(OBJREC *o);
void mid_label(OBJREC *o);
void scroll_bar_v(OBJREC *o);
void scroll_button(OBJREC *o);
void scroll_support();
void scroll_support(void);
void scroll_bar_h(OBJREC *o);
void button2(OBJREC *o);
void resizer(OBJREC *o);

View file

@ -3,15 +3,15 @@
word *GetScreenAdr();
word *GetBuffer2nd();
int32_t GetScreenPitch();
int32_t GetBuffer2ndPitch();
int32_t GetScreenSizeBytes();
word *GetScreenAdr(void);
word *GetBuffer2nd(void);
int32_t GetScreenPitch(void);
int32_t GetBuffer2ndPitch(void);
int32_t GetScreenSizeBytes(void);
void RedirectScreen(word *newaddr);
void RestoreScreen();
void RedirectScreenBufferSecond();
void RestoreScreen(void);
void RedirectScreenBufferSecond(void);
extern word curcolor,charcolors[7];
@ -99,35 +99,35 @@ void showview256(word x,word y,word xs,word ys);
void showview_lo(word x,word y,word xs,word ys);
void outtext(char *text);
int initmode_dx(char inwindow, char zoom, char monitor, int refresh);
int initmode32();
int initmode32b();
int initmode32(void);
int initmode32b(void);
int initmode256(void *paletefile);
int initmode256b(void *paletefile);
int initmode_lo(void *paletefile);
int initmode16(void *paletefile);
int initmode64(void *paletefile);
int initmode64b(void *paletefile);
void *create_hixlat();
void closemode();
void *create_hixlat(void);
void closemode(void);
void line32(word x1,word y1, word x2, word y2);
void position(word x,word y);
void outtext(char *text);
void show_ms_cursor(integer x,integer y);
void *register_ms_cursor(void *cursor);
void move_ms_cursor(integer newx,integer newy,char nodraw);
void hide_ms_cursor();
void hide_ms_cursor(void);
int text_height(char *text);
int text_width(char *text);
void set_aligned_position(int x,int y,char alignx, char aligny,char *text);
void wait_retrace();
void pal_optimize();
void wait_retrace(void);
void pal_optimize(void);
void rectangle(int x1,int y1,int x2,int y2,int color);
word *mapvesaadr1(word *a);
void *create_special_palette();
void *create_special_palette2();
void *create_blw_palette16();
void *create_special_palette(void);
void *create_special_palette2(void);
void *create_blw_palette16(void);
void rel_position_x(word x);
int init_empty_mode();
int init_empty_mode(void);
void put_8bit_clipped(void *src,void *trg,int startline,int velx,int vely);
//#pragma aux put_8bit_clipped parm [ESI][EDI][EAX][EBX][EDX] modify [ECX];

View file

@ -715,8 +715,8 @@ void *create_blw_palette16()
char *c;
int i,j,k;
void *z;
char pal_colors[]={0,1,2,3,4,5,20,7,56,57,58,59,60,61,62,63};
char carnat[]={0,1,3,2,4,5,7,6,12,13,15,14,8,9,11,10};
uint8_t pal_colors[]={0,1,2,3,4,5,20,7,56,57,58,59,60,61,62,63};
uint8_t carnat[]={0,1,3,2,4,5,7,6,12,13,15,14,8,9,11,10};
z=c=getmem(3*256+2*32768);
for(i=0;i<16;i++)

View file

@ -352,7 +352,7 @@ void put_picture(word x,word y,void *p)
if (mode==8 || mode==264)
{
word *table=data;
char *cdata=(char *)(data+(mode==264?10*256:256));
uint8_t *cdata=(uint8_t *)(data+(mode==264?10*256:256));
int i;
int j;
@ -367,7 +367,7 @@ void put_picture(word x,word y,void *p)
else if (mode==512 )
{
word *table=data;
char *cdata=(char *)(data+256);
uint8_t *cdata=(uint8_t *)(data+256);
int i;
int j;
@ -414,8 +414,6 @@ void put_image(word *image,word *target,int start_line,int sizex,int sizey)
int32_t scr_linelen2 = GetScreenPitch();
word *esi = image;
word *edi = target;
int eax = start_line;
int ebx = sizex;
int edx = sizey;
int ecx = esi[0];
esi = esi + 3 + start_line * ecx;
@ -718,7 +716,6 @@ void put_picture2picture(word *source,word *target,int xp,int yp)
word src_cx = srchdr[0];
word trg_cx = trghdr[0];
word src_cy = srchdr[1];
word trg_cy = trghdr[1];
word y;
unsigned char *srcimagedata = (unsigned char *)source+pic_start;

View file

@ -9,12 +9,12 @@
extern MS_EVENT ms_last_event;
short init_mysky();
short done_mysky();
void ukaz_mysku();
void schovej_mysku();
void zobraz_mysku();
short init_mysky(void);
short done_mysky(void);
void ukaz_mysku(void);
void schovej_mysku(void);
void zobraz_mysku(void);
void set_ms_finger(int x,int y);
void update_mysky(void);
char je_myska_zobrazena();
char je_myska_zobrazena(void);
#endif

View file

@ -56,7 +56,7 @@ char *cz_key_tabs[]={cz_table_1,cz_table_2,cz_table_3};
void keyboard(EVENT_MSG *msg,void *user_data)
{
int i;
static char cz_mode=0;
static uint8_t cz_mode=0;
char c,d;
msg;user_data;

View file

@ -19,5 +19,5 @@ extern TMS_BASIC_INFO ms_basic_info;
int lock_region (void *address, unsigned length);
void keyboard(EVENT_MSG *msg,void *user_data);
char ms_get_keycount();
char ms_get_keycount(void);
#endif

View file

@ -15,7 +15,6 @@
#include <signal.h>
#include <assert.h>
static jmp_buf jmpenv;
#define find_event_msg(where,what,res) \
{\
@ -285,7 +284,6 @@ static int call_proc(EVENT_MSG *msg, void *ctx) {
T_EVENT_POINT *install_event(T_EVENT_ROOT **tree,int32_t ev_num,EV_PROC proc,void *procdata,char end)
//instaluje novou udalost;
{
EVENT_MSG x;
void *user=NULL;
T_EVENT_POINT *p;
call_proc_context ctx = {proc, &user};
@ -299,7 +297,6 @@ T_EVENT_POINT *install_event(T_EVENT_ROOT **tree,int32_t ev_num,EV_PROC proc,voi
void deinstall_event(T_EVENT_ROOT **tree,int32_t ev_num,EV_PROC proc,void *procdata)
//deinstaluje udalost;
{
EVENT_MSG x;
T_EVENT_ROOT *r;
T_EVENT_POINT *p;
@ -317,9 +314,7 @@ void deinstall_event(T_EVENT_ROOT **tree,int32_t ev_num,EV_PROC proc,void *procd
void tree_basics(T_EVENT_ROOT **ev_tree,EVENT_MSG *msg)
{
char *p;
void (*q)();
EVENT_MSG tg;
if (msg->msg==E_ADD || msg->msg==E_ADDEND)
{
@ -394,6 +389,7 @@ int send_message_to(int (*cb)(EVENT_MSG *, void *), void *ctx, int message, ...)
va_start(x.data, message);
int r = cb(&x, ctx);
va_end(x.data);
return r;
}
static void send_message_to_tree(EVENT_MSG *x) {
@ -430,7 +426,7 @@ void timer(EVENT_MSG *msg)
}
}
void tasker(EVENT_MSG *msg,void **)
void tasker(EVENT_MSG *msg,void **_)
{

View file

@ -99,7 +99,7 @@ extern char *otevri_zavoru;
//extern int curtask;
//extern char *task_info;
void init_events();
void init_events(void);
// inicalizuje zakladni strom udalosto
void send_message(int message,...);
@ -121,8 +121,8 @@ static __inline void shift_message(EVENT_MSG *msg) {
msg->msg = va_arg(msg->data, int);
}
void do_events();
void escape();
void do_events(void);
void escape(void);
#include <legacy_coroutines.h>
/*

View file

@ -36,7 +36,7 @@ void empty1(OBJREC *o)
o;
}
void empty2_p(OBJREC *o, va_list)
void empty2_p(OBJREC *o, va_list _)
{
o;
}
@ -328,7 +328,7 @@ void add_to_idlist(OBJREC *o)
void define(int id,int x,int y,int xs,int ys,char align,void (*initproc)(OBJREC *),...)
{
OBJREC *o;
int32_t *p;
o=(OBJREC *)getmem(sizeof(OBJREC));
o->x=x;o->y=y;o->xs=xs;o->ys=ys;
@ -341,8 +341,8 @@ void define(int id,int x,int y,int xs,int ys,char align,void (*initproc)(OBJREC
o->autoresizey=0;
o->on_event=empty;
o->on_enter=empty;
o->on_exit=empty1;
o->on_change=empty3;
o->on_exit=empty;
o->on_change=empty;
o->enabled=1;
o->draw_error=0;
o->color=waktual->color;memcpy(o->f_color,f_default,sizeof(f_default));
@ -873,10 +873,11 @@ void set_enable(int win_id,int obj_id,int condition)
condition=(condition!=0);
if ((o=find_object_desktop(win_id,obj_id,&w))==NULL) return;
if (o==o_aktual)
if (o==o_aktual) {
if (send_lost()) return;
else
} else {
o_aktual=NULL;
}
if (o->enabled!=condition)
{
o->enabled=condition;
@ -892,7 +893,7 @@ void close_current()
void background_runner(EVENT_MSG *msg,void **prog)
{
void (*p)();
char i=1;
if (msg->msg==E_INIT)
{
@ -906,7 +907,7 @@ void background_runner(EVENT_MSG *msg,void **prog)
}
p=*prog;
p();
i=0;
msg->msg=-2;
}

View file

@ -76,9 +76,9 @@ typedef struct objrec
void (*call_event)(EVENT_MSG *msg, struct objrec *);
void (*call_done)(struct objrec *);
void (*on_event)(EVENT_MSG *msg, struct objrec *);
void (*on_enter)();
void (*on_exit)();
void (*on_change)();
void (*on_enter)(void);
void (*on_exit)(void);
void (*on_change)(void);
char draw_error; //1 znamena ze objekt zpusobil chybu a nebude vykreslovan
struct objrec *next;
}OBJREC;
@ -134,22 +134,22 @@ int32_t desktop_add_window(WINDOW *w);
void select_window(int32_t id);
WINDOW *find_window(int32_t id);
void redraw_object(OBJREC *o);
void redraw_window();
void redraw_window(void);
void define(int id,int x,int y,int xs,int ys,char align,void (*initproc)(OBJREC *),...);
CTL3D *border(word light,word shadow, word bsize, word btype);
void property(CTL3D *ctl,word *font,FC_TABLE *fcolor,word color);
FC_TABLE *flat_color(word color);
void aktivate_window(MS_EVENT *ms);
void redraw_desktop();
void redraw_desktop(void);
void close_window(WINDOW *w);
void close_current();
void close_current(void);
void check_window(WINDOW *w);
void install_gui(void);
void uninstall_gui(void);
void on_control_change(void (*proc)());
void on_control_enter(void (*proc)());
void on_control_exit(void (*proc)());
void on_control_event(void (*proc)());
void on_control_change(void (*proc)(void));
void on_control_enter(void (*proc)(void));
void on_control_exit(void (*proc)(void));
void on_control_event(void (*proc)(EVENT_MSG *, struct objrec *));
void terminate_gui(void);
void set_change(void);
void set_value(int win_id,int obj_id,void *value);
@ -158,11 +158,11 @@ void c_set_value(int win_id,int obj_id,int cnst);
void c_default(int cnst);
int f_get_value(int win_id,int obj_id);
void get_value(int win_id,int obj_id,void *buff);
void cancel_event();
void cancel_event(void);
OBJREC *find_object(WINDOW *w,int id);
void set_window_modal(void);
void set_enable(int win_id,int obj_id,int condition);
void run_background(void (*p)());
void run_background(void (*p)(void));
void disable_bar(int x,int y,int xs,int ys,word color);
void movesize_win(WINDOW *w, int newx,int newy, int newxs, int newys);
void goto_control(int obj_id);

View file

@ -1,2 +1,2 @@
#include <string.h>
#include <malloc.h>
#include <malloc.h>

View file

@ -96,7 +96,8 @@ void *getmem(int32_t size)
void *load_file(char *filename)
{
FILE *f;
int32_t size,*p;
int32_t *p;
size_t size;
if (mman_action!=NULL) mman_action(MMA_READ);
SEND_LOG("(LOAD) Loading file '%s'",filename,0);
@ -268,7 +269,6 @@ THANDLE_DATA *get_handle(int handle)
void heap_error(size_t size) //heap system
{
int i,j;
char swaped=0;
uint32_t maxcounter=0;
THANDLE_DATA *sh;
char repeat=0,did=0;
@ -290,7 +290,7 @@ void heap_error(size_t size) //heap system
h=((THANDLE_DATA *)_handles[i]+j);
c=bk_global_counter-h->counter;
if (h->status==BK_PRESENT && ~h->flags & BK_LOCKED)
if (h->status==BK_PRESENT && ~h->flags & BK_LOCKED) {
if (last_free!=NULL)
{
d=(char *)h->blockdata-last_free;
@ -304,6 +304,7 @@ void heap_error(size_t size) //heap system
num=i*BK_MINOR_HANDLES+j;
}
}
}
}
if (lastblock==sh)
{
@ -324,7 +325,6 @@ void heap_error(size_t size) //heap system
{
free(sh->blockdata);
sh->status=BK_SWAPED;
swaped=1;
}
}
else
@ -373,7 +373,7 @@ THANDLE_DATA *zneplatnit_block(int handle)
return h;
}
void init_manager(char *filename,char */*swap is not supported*/) // filename= Jmeno datoveho souboru nebo NULL pak
void init_manager(char *filename,char *swap_is_not_supported) // filename= Jmeno datoveho souboru nebo NULL pak
// se pouzije DOS
// swp je cesta do TEMP adresare
{
@ -537,7 +537,8 @@ void *ablock(int handle)
if (h->src_file[0]!=0)
{
if (mman_action!=NULL) mman_action(MMA_READ);
strcpy(c,mman_pathlist[h->path]);strcat(c,h->src_file);
strcpy(c,mman_pathlist[h->path]);
strcat(c,h->src_file);
c[strlen(mman_pathlist[h->path])+12]='\0';
p=load_file(c);
s=last_load_size;
@ -668,12 +669,12 @@ int apreload_sort(const void *val1,const void *val2)
void apreload_start(void (*percent)(int cur,int max))
{
word *p;
short *p;
int i;
int c,z;
swap_status=0;
p=NewArr(word,max_sign);
p=NewArr(short,max_sign);
for(i=0;i<max_sign;i++) p[i]=i;
qsort(p,max_sign,sizeof(word),apreload_sort);
for(i=0,c=0;i<max_sign;i++) if (apr_sign[p[i]]==0x7f7f7f7f)p[i]=-1;else c++;
@ -733,7 +734,7 @@ void close_manager()
//------------------------------------------------------------
/*static void block()
{
/* static MEMINFO inf;
static MEMINFO inf;
void *c;
static counter=0;
@ -801,7 +802,7 @@ void display_status()
void *grealloc(void *p,int32_t size)
{
void *q;
int32_t scop;
if (!size)
{

View file

@ -30,7 +30,7 @@ typedef struct thandle_data
int32_t seekpos; //16
void *blockdata; //20
char flags; //21
char path; //22
uint8_t path; //22
short status;
void (*loadproc)(void **data,int32_t *size);//28
unsigned short lockcount; //32
@ -61,7 +61,7 @@ typedef handle_list *handle_groups[BK_MAJOR_HANDLES];
extern char **mman_pathlist; //tento pointer musi byt naplnen ukazatelem na tabulku cest
extern void (*mem_error)(size_t); //pokud neni NULL je tato funkce volana vzdy kdyz dojde pamet a system si s tim nevi rady
extern void (*swap_error)();
extern void (*swap_error)(void);
extern int memman_handle; //cislo handle naposled zpracovavaneho prikazem ablock
extern char mman_patch; //jednicka zapina moznost pouziti patchu
void *getmem(int32_t size); //alokace pameti pres memman. alokovat pomoci malloc lze ale hrozi nebezpeci ze vrati NULL
@ -75,8 +75,8 @@ void aunlock(int handle); //odmyka blok
void aswap(int handle); //zapina swapovani pro blok
void aunswap(int handle); //vypina swapovani pro blok
void apreload(int handle); //zapina preloading pro blok (preloading proved pomoci ablock)
//void free(); //free
void close_manager(); //uzavre manager a uvolni veskerou pamet
//void free(void); //free
void close_manager(void); //uzavre manager a uvolni veskerou pamet
void undef_handle(int handle); //uvolni hadle k dalsimu pouziti
THANDLE_DATA *zneplatnit_block(int handle); //zneplatni data bloku
THANDLE_DATA *get_handle(int handle); //vraci informace o rukojeti
@ -105,17 +105,17 @@ FILE *afiletemp(char *filename, int group);
extern void (*mman_action)(int action); //udalost volajici se pri akci mmanagera.
void display_status(); //zobrazi na display status memmanageru
void display_status(void); //zobrazi na display status memmanageru
#ifdef LOGFILE
char *get_time_str();
int q_current_task();
char *get_time_str(void);
int q_current_task(void);
#define OPEN_LOG(log) memcpy(stderr,fopen(log,"w"),sizeof(FILE));
#define SEND_LOG(format,parm1,parm2) fprintf(stderr,"%-2d %s "format"\n",q_current_task(),get_time_str(),parm1,parm2),fflush(stderr)
#define CLOSE_LOG() fclose(logfile);
#define SEND_LOG(format,parm1,parm2) fprintf(stderr,"%-2d %s "format"\n",q_current_task(void),get_time_str(void),parm1,parm2),fflush(stderr)
#define CLOSE_LOG(void) fclose(logfile);
#else
#define OPEN_LOG(log)
#define SEND_LOG(format,parm1,parm2)
#define CLOSE_LOG()
#define CLOSE_LOG(void)
#endif
#endif

View file

@ -30,7 +30,7 @@ static int nextgroup;
static int bitsize,init_bitsize;
char old_value=0;
void do_clear_code()
void do_clear_code(void)
{
int i;
@ -45,7 +45,7 @@ void do_clear_code()
}
}
void reinit_lzw()
void reinit_lzw(void)
{
do_clear_code();
}
@ -63,7 +63,7 @@ void init_lzw_compressor(int dic_size)
}
void done_lzw_compressor()
void done_lzw_compressor(void)
{
free(compress_dic);
compress_dic=NULL;
@ -90,7 +90,7 @@ void *open_mgif(void *mgif) //vraci ukazatel na prvni frame
return c;
}
void close_mgif() //dealokuje buffery pro prehravani
void close_mgif(void) //dealokuje buffery pro prehravani
{
done_lzw_compressor();
free(lzw_buffer);
@ -180,8 +180,8 @@ int fast_expand_code(DOUBLE_S *compress_dic, int code,uint8_t **target, uint8_t
*old_value = w;
**target = out;
(*target)++;
return code;
}
return out;
/*
_asm
{
@ -237,16 +237,16 @@ void lzw_decode(void *source,char *target)
//int group,chr;
int old_first;
register int mask=0xff;
uint8_t old_value;
for(i=0;i<LZW_MAX_CODES;i++) compress_dic[i].first=0;
clear:
uint8_t old_value=0;
old_value=0;
nextgroup=free_code;
bitsize=init_bitsize;
mask=(1<<bitsize)-1;
code=input_code(source,&bitpos,bitsize,mask);
uint8_t *t = target;
uint8_t *t = (uint8_t *)target;
old_first=fast_expand_code(compress_dic,code,&t,&old_value);
old=code;
while ((code=input_code(source,&bitpos,bitsize,mask))!=end_code)

View file

@ -36,5 +36,5 @@ typedef struct mgif_header
void mgif_install_proc(MGIF_PROC proc);
void *open_mgif(void *mgif); //vraci ukazatel na prvni frame
void *mgif_play(void *mgif); //dekoduje a zobrazi frame
void close_mgif(); //dealokuje buffery pro prehravani
void close_mgif(void); //dealokuje buffery pro prehravani
#endif

View file

@ -42,12 +42,12 @@ void decomprimate_line_hi(char *src,unsigned short *trg,unsigned short *paleta,i
{
int i,j;
i=(*src++) & 0x3f;
for (j=0;j<i;j++) *trg++=paleta[*src];
for (j=0;j<i;j++) *trg++=paleta[(uint8_t)*src];
src++;
linelen-=i-1;
}
else
*trg++=paleta[*src++];
*trg++=paleta[(uint8_t)*src++];
}
*srcstep=src-srcsave;
}

View file

@ -91,13 +91,12 @@ static int set_line_back(TSTR_LIST ls,int line)
void string_list_draw(int x1,int y1,int x2,int y2,OBJREC *o)
{
STRING_LIST_DATA *p;
int xs,ys,y;
int y;
char savech[]=" ";
int znh,i,j,max;
TSTR_LIST ls;
int savcolor=curcolor;
xs=x2-x1;ys=y2-y1;
p=o->userptr;
ls=p->list;
bar32(x1,y1,x2,y2);
@ -182,7 +181,7 @@ void string_list_event(EVENT_MSG *msg,OBJREC *o)
i=get_to_topline(ls,p->topline,NULL);
ms=get_mouse(msg);
curfont=o->font;
if (ms->tl1 && clicked || ms->event_type & 0x2)
if ((ms->tl1 && clicked) || (ms->event_type & 0x2))
{
if (ls)
do

View file

@ -9,10 +9,11 @@
TSTR_LIST create_list(int count)
{
TSTR_LIST p;int i,j;
TSTR_LIST p;
int i;
size_t *s=(size_t *)malloc(count*sizeof(*p)+sizeof(size_t));
if (p==NULL) return NULL;
if (s==NULL) return NULL;
*s = count;
p = (TSTR_LIST)(s+1);
for(i=0;i<count;i++) p[i]=NULL;
@ -28,8 +29,7 @@ int find_ptr(TSTR_LIST source,void *_ptr,int _size)
const char *str_replace(TSTR_LIST *list,int line,const char *text)
{
int count,i,j;
TSTR_LIST p;
int count;
char *c;
count=str_count(*list);
@ -61,7 +61,7 @@ const char *str_replace(TSTR_LIST *list,int line,const char *text)
int str_add(TSTR_LIST *list,const char *text)
{
int count,i;
TSTR_LIST p;
count=str_count(*list);
i=find_ptr(*list,NULL,count);
@ -72,7 +72,7 @@ int str_add(TSTR_LIST *list,const char *text)
const char *str_insline(TSTR_LIST *list,int before,const char *text)
{
int i,count,punkt;
TSTR_LIST p;
count=str_count(*list);
punkt=find_ptr(*list,NULL,count);
@ -90,7 +90,6 @@ void str_remove(TSTR_LIST *list,int line)
void str_delfreelines(TSTR_LIST *list)
{
int count,i,j;
TSTR_LIST p;
count=str_count(*list);
j=0;
@ -101,7 +100,7 @@ void str_delfreelines(TSTR_LIST *list)
int str_count(TSTR_LIST p)
{
int count;
if (p==NULL) return 0;
return *((size_t *)p-1);

View file

@ -23,17 +23,17 @@ extern int bvolume;
int sound_detect(int *dev,int *port,int *dma, int *irq);
void set_mixing_device(int mix_dev,int mix_freq,...);
char start_mixing();
void stop_mixing();
char start_mixing(void);
void stop_mixing(void);
void play_sample(int channel,void *sample,int32_t size,int32_t lstart,int32_t sfreq,int type);
void set_channel_volume(int channel,int left,int right);
void set_end_of_song_callback(const char * (*cb)(void *), void *ctx);
void fade_music();
void fade_music(void);
int mix_back_sound(int synchro);
int open_backsound(char *filename);
void change_music(const char *filename);
int get_timer_value();
int get_timer_value(void);
char *device_name(int device);
void force_music_volume(int volume);