Differences From Artifact [08cbbc44cd]:
- File
src/OFFile.m
— part of check-in
[722b6213c0]
at
2009-04-09 13:55:55
on branch trunk
— Use char* instead of uint8_t* for OFStreams and OFHashes.
This way, less casts are needed when using C libraries. (user: js, size: 2966) [annotate] [blame] [check-ins using]
To Artifact [de67b84ef2]:
- File
src/OFFile.m
— part of check-in
[139591afe1]
at
2009-04-19 20:34:38
on branch trunk
— Use isa instead of [self class].
Since we don't use Object anymore and define isa in OFObject, we can
rely on it. (user: js, size: 2939) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
80 81 82 83 84 85 86 | - initWithPath: (const char*)path andMode: (const char*)mode { Class c; if ((self = [super init])) { if ((fp = fopen(path, mode)) == NULL) { | | | 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 | - initWithPath: (const char*)path andMode: (const char*)mode { Class c; if ((self = [super init])) { if ((fp = fopen(path, mode)) == NULL) { c = isa; [super free]; @throw [OFOpenFileFailedException newWithClass: c andPath: path andMode: mode]; } } return self; |
︙ | ︙ | |||
109 110 111 112 113 114 115 | - (size_t)readNItems: (size_t)nitems ofSize: (size_t)size intoBuffer: (char*)buf { size_t ret; if ((ret = fread(buf, size, nitems, fp)) == 0 && !feof(fp)) | | | 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 | - (size_t)readNItems: (size_t)nitems ofSize: (size_t)size intoBuffer: (char*)buf { size_t ret; if ((ret = fread(buf, size, nitems, fp)) == 0 && !feof(fp)) @throw [OFReadFailedException newWithClass: isa andSize: size andNItems: nitems]; return ret; } - (size_t)readNBytes: (size_t)size |
︙ | ︙ | |||
132 133 134 135 136 137 138 | ofSize: (size_t)size fromBuffer: (const char*)buf { size_t ret; if ((ret = fwrite(buf, size, nitems, fp)) == 0 && size != 0 && nitems != 0) | | | 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 | ofSize: (size_t)size fromBuffer: (const char*)buf { size_t ret; if ((ret = fwrite(buf, size, nitems, fp)) == 0 && size != 0 && nitems != 0) @throw [OFWriteFailedException newWithClass: isa andSize: size andNItems: nitems]; return ret; } - (size_t)writeNBytes: (size_t)size |
︙ | ︙ |