From octave-sources-request at bevo dot che dot wisc dot edu Fri Nov 14 10:03:51 2003 Subject: fread documentation (patch) From: Teemu Ikonen To: octave-sources at bevo dot che dot wisc dot edu Date: Fri, 14 Nov 2003 18:01:12 +0200 --hHWLQfXTYDoKhP50 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, Attached is a documentation patch to fread, which adds unsigned integer types to the list of supported formats. A quick look at the sources reveals that reading 64-bit integers is only supported if SIZEOF(long) == 64 in the architecture in question. In i386 I this is obviously not the case and I get: > a = fread(fid, "int64"); error: unable to find matching native data type for int64 error: fread: invalid data type specified A 64-bit int should fit nicely into a 64-bit double (although it loses information), so this architecture dependent limitation is kind of arbitrary. Perhaps there's not an easy fix to this problem? Best wishes, Teemu --hHWLQfXTYDoKhP50 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="file-io.cc.patch" --- orig/octave/src/file-io.cc +++ mod/octave/src/file-io.cc at @ -1181,6 +1181,7 @@ \n\ at item \"unsigned char\"\n\ at itemx \"uchar\"\n\ + at itemx \"uint8\"\n\ Unsigned character.\n\ \n\ at item \"short\"\n\ at @ -1216,11 +1217,17 @@ \n\ at item \"integer*2\"\n\ at itemx \"int16\"\n\ -Two byte integer.\n\ +Two byte signed integer.\n\ \n\ at item \"integer*4\"\n\ at itemx \"int32\"\n\ -Four byte integer.\n\ +Four byte signed integer.\n\ +\n\ + at item \"uint16\"\n\ +Two byte unsigned integer.\n\ +\n\ + at item \"uint32\"\n\ +Four byte unsigned integer.\n\ at end table\n\ \n\ at noindent\n\ --hHWLQfXTYDoKhP50--