Skip to content

Commit

Permalink
Release Cosmpolitan v3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
jart committed Nov 19, 2023
1 parent e4dea37 commit 69faf1b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 39 deletions.
4 changes: 2 additions & 2 deletions libc/integral/normalize.inc
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
#endif

#define __COSMOPOLITAN_MAJOR__ 3
#define __COSMOPOLITAN_MINOR__ 0
#define __COSMOPOLITAN_PATCH__ 2
#define __COSMOPOLITAN_MINOR__ 1
#define __COSMOPOLITAN_PATCH__ 0
#define __COSMOPOLITAN__ \
(100000000 * __COSMOPOLITAN_MAJOR__ + 1000000 * __COSMOPOLITAN_MINOR__ + \
__COSMOPOLITAN_PATCH__)
Expand Down
39 changes: 2 additions & 37 deletions tool/decode/zip.c
Original file line number Diff line number Diff line change
Expand Up @@ -454,41 +454,6 @@ void ShowCentralDirHeader64(uint8_t *cd) {
show(".long", format(b1, "%d", READ32LE(cd + 4 + 4 + 8)), "totaldisks");
}

static const char *DescribeZipError(int err) {
switch (err) {
case kZipErrorEocdNotFound:
return "kZipErrorEocdNotFound";
case kZipErrorEocdOffsetOverflow:
return "kZipErrorEocdOffsetOverflow";
case kZipErrorEocdMagicNotFound:
return "kZipErrorEocdMagicNotFound";
case kZipErrorEocdSizeOverflow:
return "kZipErrorEocdSizeOverflow";
case kZipErrorEocdDiskMismatch:
return "kZipErrorEocdDiskMismatch";
case kZipErrorEocdOffsetSizeOverflow:
return "kZipErrorEocdOffsetSizeOverflow";
case kZipErrorEocdRecordsMismatch:
return "kZipErrorEocdRecordsMismatch";
case kZipErrorEocdRecordsOverflow:
return "kZipErrorEocdRecordsOverflow";
case kZipErrorCdirOffsetPastEocd:
return "kZipErrorCdirOffsetPastEocd";
case kZipErrorEocdLocatorMagic:
return "kZipErrorEocdLocatorMagic";
case kZipErrorEocdLocatorOffset:
return "kZipErrorEocdLocatorOffset";
case kZipErrorRaceCondition:
return "kZipErrorRaceCondition";
case kZipErrorMapFailed:
return "kZipErrorMapFailed";
case kZipErrorOpenFailed:
return "kZipErrorOpenFailed";
default:
return "unknown";
}
}

int IsZipEocd32(const uint8_t *p, size_t n, size_t i) {
size_t offset;
if (i > n || n - i < kZipCdirHdrMinSize) {
Expand Down Expand Up @@ -529,8 +494,8 @@ uint8_t *GetZipCdir32(const uint8_t *p, size_t n) {
return (/*unconst*/ uint8_t *)(p + i);
}
kprintf("warning: found eocd32 magic at offset 0x%lx that didn't look "
"like an eocd32 record: %s\n",
i, DescribeZipError(err));
"like an eocd32 record\n",
i);
}
}
}
Expand Down

0 comments on commit 69faf1b

Please sign in to comment.