1
0
mirror of https://github.com/pcvolkmer/osc-variant.git synced 2025-04-20 20:26:50 +00:00

chore: code cleanup

This commit is contained in:
Paul-Christian Volkmer 2024-04-24 08:00:40 +02:00
parent 5e297a0353
commit 79193ba91b
4 changed files with 10 additions and 7 deletions

View File

@ -30,7 +30,10 @@ void deob(char * in) {
for (size_t i = 0; i < DL; i++) d[i] = (CS)[i]; for (size_t i = 0; i < DL; i++) d[i] = (CS)[i];
size_t l = strlen(in) / 2; size_t l = strlen(in) / 2;
for (size_t i = 0; i < l; i++) { for (size_t i = 0; i < l; i++) {
for (size_t j = 0; j < DL; j++) { DLT(0); DLT(1); } for (size_t j = 0; j < DL; j++) {
DLT(0);
DLT(1);
}
DLS(i); DLS(i);
} }
INZ(l); INZ(l);

View File

@ -32,7 +32,7 @@
#define S0 8373972096940928081 #define S0 8373972096940928081
#define S1 7378413942531504450 #define S1 7378413942531504450
#define CS (char*)&s #define CS (char*)&s
#define DL sizeof(d) / sizeof(d[0]) - 2 #define DL sizeof(d) / sizeof(d[0]) - 3
#define I2 i*2 #define I2 i*2
#define INZ(var) in[var] = 0 #define INZ(var) in[var] = 0
#define DLS(idx) in[idx] = (d[DL+1]<<4)|d[DL] #define DLS(idx) in[idx] = (d[DL+1]<<4)|d[DL]

View File

@ -141,7 +141,7 @@ impl InputFile {
} }
} else { } else {
return Err(FileError::Parsing( return Err(FileError::Parsing(
filename.into(), filename,
"Kann OSB-Datei nicht lesen".to_string(), "Kann OSB-Datei nicht lesen".to_string(),
)); ));
} }

View File

@ -88,7 +88,7 @@ pub fn unzip_osb_using_password(path: &str, dir: &str, password: &str) {
}; };
let outpath = match file.enclosed_name() { let outpath = match file.enclosed_name() {
Some(path) => Path::new(dir).join(path.to_owned()), Some(path) => Path::new(dir).join(&path),
None => continue, None => continue,
}; };