1
0
mirror of https://gittea.dev/nova/th.git synced 2025-10-21 10:20:15 -04:00

Compare commits

..

2 Commits

Author SHA1 Message Date
nova
c923497f01 cast to unsigned char for proper sorting 2025-08-30 21:04:30 +02:00
nova
69f9a609e5 removal of socal_status 2025-08-30 21:01:40 +02:00
3 changed files with 13 additions and 20 deletions

View File

@@ -28,8 +28,8 @@ int sort_natural(const void *file0_, const void *file1_){
file *file0 = (file*)file0_;
file *file1 = (file*)file1_;
unsigned char *a = file0->file_name;
unsigned char *b = file1->file_name;
unsigned char *a = (unsigned char*)file0->file_name;
unsigned char *b = (unsigned char*)file1->file_name;
if (file0->file_type & (FILE_TYPE_SYMLINK | FILE_TYPE_DIR) && !(file1->file_type & (FILE_TYPE_SYMLINK | FILE_TYPE_DIR))) {
return -1;

View File

@@ -47,7 +47,7 @@ extern unsigned int terminal_width;
extern unsigned int status;
void *thread_mid(void *data){
void *thread_mid(){
while(!(status & STATUS_QUIT_PROGRAM)){
pthread_mutex_lock(&mutex_mid);
@@ -99,8 +99,7 @@ void *thread_mid(void *data){
}
pthread_exit(0);
}
void *thread_lft(void *data){
unsigned int local_status = *(unsigned int*)data;
void *thread_lft(){
while(!(status & STATUS_QUIT_PROGRAM)){
pthread_mutex_lock(&mutex_lft);
@@ -116,7 +115,7 @@ void *thread_lft(void *data){
path[strrchr(path, '/')-path] = '\0';
path[0] = '/';
if (local_status & STATUS_RELOAD_DIRECTORY) {
if (status & STATUS_RELOAD_DIRECTORY) {
lft_file_count = get_dir_size(path);
free(lft_content);
lft_content = malloc(lft_file_count * sizeof(file));
@@ -132,9 +131,7 @@ void *thread_lft(void *data){
}
void *thread_rgt(void *data){
unsigned int local_status = *(unsigned int*)data;
(void)local_status;
void *thread_rgt(){
file file_current;
while(!(status & STATUS_QUIT_PROGRAM)){
@@ -216,9 +213,7 @@ void *thread_rgt(void *data){
}
pthread_exit(0);
}
void *thread_top(void *data){
unsigned int local_status = *(unsigned int*)data;
(void)local_status;
void *thread_top(){
while(!(status & STATUS_QUIT_PROGRAM)){
pthread_mutex_lock(&mutex_top);
@@ -241,9 +236,7 @@ void *thread_top(void *data){
}
pthread_exit(0);
}
void *thread_btm(void *data){
unsigned int local_status = *(unsigned int*)data;
(void)local_status;
void *thread_btm(){
while(!(status & STATUS_QUIT_PROGRAM)){
pthread_mutex_lock(&mutex_btm);

View File

@@ -5,10 +5,10 @@
#include "threading.c"
#endif
void *thread_lft(void *data);
void *thread_mid(void *data);
void *thread_rgt(void *data);
void *thread_top(void *data);
void *thread_btm(void *data);
void *thread_lft();
void *thread_mid();
void *thread_rgt();
void *thread_top();
void *thread_btm();
void threading_init();
void threading_free();