From ee9c0f97fcc09235b3497205f2f1d5a32a29b991 Mon Sep 17 00:00:00 2001 From: "Kirill Lipatov (Leency)" Date: Fri, 25 Jun 2021 13:21:42 +0000 Subject: [PATCH] cmm: proper testbit git-svn-id: svn://kolibrios.org@8944 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/cmm/eolite/Eolite.c | 15 ++++++--------- programs/cmm/eolite/include/copy_and_delete.h | 7 ++----- programs/cmm/eolite/include/properties.h | 4 ++-- programs/cmm/lib/copyf.h | 2 +- programs/cmm/lib/fs.h | 4 ++-- programs/cmm/lib/gui.h | 5 ++--- programs/cmm/lib/io.h | 2 +- programs/cmm/search/search.c | 2 +- 8 files changed, 17 insertions(+), 24 deletions(-) diff --git a/programs/cmm/eolite/Eolite.c b/programs/cmm/eolite/Eolite.c index e2233e7e20..db7b005eb1 100644 --- a/programs/cmm/eolite/Eolite.c +++ b/programs/cmm/eolite/Eolite.c @@ -831,7 +831,7 @@ void Line_ReDraw(dword bgcol, filenum){ file.sizehi = ESDWORD[file_offet+36]; file_name_off = file_offet+40; - if (! TestBit(attr, 4) ) //file or folder? + if (! attr & ATR_FOLDER) //file or folder? { ext1 = strrchr(file_name_off,'.') + file_name_off; if (ext1==file_name_off) ext1 = NULL; //if no extension then show nothing @@ -849,11 +849,11 @@ void Line_ReDraw(dword bgcol, filenum){ if (file_size) WriteText(7-strlen(file_size)*6+files.x+files.w-58, files.text_y+y+1, files.font_type, col.list_gb_text, file_size); - if (TestBit(attr, 1)) || (TestBit(attr, 2)) text_col=col.list_text_hidden; //system or hiden? + if (attr&2) || (attr&4) text_col=col.list_text_hidden; //system or hiden? if (bgcol==col.selec) { file_name_is_8_3(file_name_off); - itdir = TestBit(attr, 4); + itdir = attr & ATR_FOLDER; strcpy(#file_name, file_name_off); if (!strcmp(#path,"/")) sprintf(#file_path,"%s%s",#path,file_name_off); else sprintf(#file_path,"%s/%s",#path,file_name_off); @@ -948,13 +948,10 @@ inline Sorting() for (j=files.count-1, file_off=files.count-1*304+buf+32; j>=0; j--, file_off-=304;) //files | folders { if (dir_at_fat16) && (file_name_is_8_3(file_off+40)) strttl(file_off+40); - if (TestBit(ESDWORD[file_off],4)) //directory? - { + if (ESDWORD[file_off] & ATR_FOLDER) { items.set(d, j); d++; - } - else - { + } else { items.set(files.count-f, j); f++; } @@ -1042,7 +1039,7 @@ void EventOpenSelected() int i; for (i=0; i0) DefineButton(x,y,w,h,id,color_b); + DefineButton(x,y,w,h,id,color_b); WriteText(tx+1,ty+1,0x90,MixColors(color_b,0,230),text); WriteText(tx,ty,0x90,color_t,text); } @@ -90,7 +89,7 @@ unsigned darker_color = MixColors(sc.button,0,230); - if (id>0) DefineButton(x,y,w,h,id,sc.button); + DefineButton(x,y,w,h,id,sc.button); WriteText(tx+1,ty+1,0x90,darker_color,text); WriteText(tx,ty,0x90,sc.button_text,text); diff --git a/programs/cmm/lib/io.h b/programs/cmm/lib/io.h index 6a61d9d25c..495ab9a020 100644 --- a/programs/cmm/lib/io.h +++ b/programs/cmm/lib/io.h @@ -392,7 +392,7 @@ if(tmp==-1)return -1; size_tmp += tmp; i++; - if (TestBit(ESDWORD[filename-40], 4))count_dirs++; + if (ESDWORD[filename-40] & ATR_FOLDER)count_dirs++; else count_files++; } diff --git a/programs/cmm/search/search.c b/programs/cmm/search/search.c index 5e6b13dbe8..20f2439f9e 100644 --- a/programs/cmm/search/search.c +++ b/programs/cmm/search/search.c @@ -276,7 +276,7 @@ void find_loop(dword way) { filename = i*304+dirbuf+72; getfullpath(cur_file,way,filename); - if (TestBit(ESDWORD[filename-40], 4) ) folder = true; else folder = false; + if (ESDWORD[filename-40] & ATR_FOLDER) folder = true; else folder = false; if (strstri(filename, #search_name)) { results.add(filename, way, folder);