Previous 15994 Revisions Next

r956 Friday 14th September, 2007 at 11:24:49 UTC by Nathan Woods
[KCCOMP] Fixed regression; also added asserts to image.c
[src/mess]image.c
[src/mess/devices]printer.c

src/mess/devices/printer.c
r955r956
1919
2020void printer_output(mess_image *img, int data)
2121{
22   UINT8 d = data;
23   image_fwrite(img, &d, 1);
22   if (image_exists(img))
23   {
24      UINT8 d = data;
25      image_fwrite(img, &d, 1);
26   }
2427}
2528
2629
src/mess/image.c
r955r956
11121112
11131113
11141114/*-------------------------------------------------
1115    check_for_file
1116-------------------------------------------------*/
1117
1118static void check_for_file(mess_image *image)
1119{
1120   assert_always(image->file != NULL, "Illegal operation on unmounted image");
1121}
1122
1123
1124
1125/*-------------------------------------------------
11151126    image_length
11161127-------------------------------------------------*/
11171128
11181129UINT64 image_length(mess_image *image)
11191130{
1131   check_for_file(image);
11201132   return core_fsize(image->file);
11211133}
11221134
r955r956
11911203
11921204UINT32 image_fread(mess_image *image, void *buffer, UINT32 length)
11931205{
1206   check_for_file(image);
11941207   return core_fread(image->file, buffer, length);
11951208}
11961209
r955r956
12021215
12031216UINT32 image_fwrite(mess_image *image, const void *buffer, UINT32 length)
12041217{
1218   check_for_file(image);
12051219   return core_fwrite(image->file, buffer, length);
12061220}
12071221
r955r956
12131227
12141228int image_fseek(mess_image *image, INT64 offset, int whence)
12151229{
1230   check_for_file(image);
12161231   return core_fseek(image->file, offset, whence);
12171232}
12181233
r955r956
12241239
12251240UINT64 image_ftell(mess_image *image)
12261241{
1242   check_for_file(image);
12271243   return core_ftell(image->file);
12281244}
12291245
r955r956
12491265
12501266int image_feof(mess_image *image)
12511267{
1268   check_for_file(image);
12521269   return core_feof(image->file);
12531270}
12541271
r955r956
12601277
12611278void *image_ptr(mess_image *image)
12621279{
1280   check_for_file(image);
12631281   return (void *) core_fbuffer(image->file);
12641282}
12651283

Previous 15994 Revisions Next


© 1998-2018 The MESS Team