[patch]: file-target fixes

2000-02-26 Thread Christoph Egger


Hi all,

I have created a patch (attached), which fixes one typo error, some
little/big-endian -stuff and also does some cleanups.

Is anyone here to get the patch into the cvs-tree?

Thanks in advance,

Christoph Egger
E-Mail: [EMAIL PROTECTED]


diff -uNr 2130/degas/lib/libggi/display/file/fileio.c 
degas/lib/libggi/display/file/fileio.c
--- 2130/degas/lib/libggi/display/file/fileio.c Tue Apr 13 07:07:28 1999
+++ degas/lib/libggi/display/file/fileio.c  Sun Feb  6 20:43:58 2000
@@ -36,7 +36,7 @@
 
 #include ggi/internal/ggi-dl.h
 #include ggi/display/file.h
-
+#include ggi/system.h
 
 int _ggi_file_create_file(ggi_visual *vis, char *filename)
 {
@@ -99,8 +99,24 @@
 
 void _ggi_file_write_word(ggi_visual *vis, int val)
 {
+#ifdef GGI_LITTLE_ENDIAN
_ggi_file_write_byte(vis, val  8);
_ggi_file_write_byte(vis, val  0xFF);
+#else
+   _ggi_file_write_byte(vis, val  0xFF);
+   _ggi_file_write_byte(vis, val  8);
+#endif
 }
 
 void _ggi_file_write_string(ggi_visual *vis, char *str)
@@ -112,7 +128,31 @@
 
 void _ggi_file_write_zeros(ggi_visual *vis, int count)
 {
-   for (; count  0; count--) {
+   while (count--) {
_ggi_file_write_byte(vis, 0);
}
 }
diff -uNr 2130/degas/lib/libggi/display/file/mode.c 
degas/lib/libggi/display/file/mode.c
--- 2130/degas/lib/libggi/display/file/mode.c   Mon Dec 13 07:10:45 1999
+++ degas/lib/libggi/display/file/mode.cSun Feb  6 20:46:08 2000
@@ -46,11 +46,12 @@
 #define MAP_FAILED ((void*)-1)
 #endif
 
-#define write_byte_ggi_file_write_byte
-#define write_word_ggi_file_write_word
-#define write_string  _ggi_file_write_string
-#define write_zeros   _ggi_file_write_zeros
-#define write_flush   _ggi_file_flush
+#define write_byte _ggi_file_write_byte
+#define write_word _ggi_file_write_word
+#define write_string   _ggi_file_write_string
+#define write_zeros_ggi_file_write_zeros
+#define write_flush_ggi_file_flush
 
 static void dowritefile(ggi_visual *vis)
 {
@@ -427,7 +428,7 @@
err--;
}
 
-   if (mode-virt.x  mode-visible.x) {
+   if (mode-virt.y  mode-visible.y) {
mode-virt.y = mode-visible.y;
err--;
}
diff -uNr 2130/degas/lib/libggi/display/file/visual.c 
degas/lib/libggi/display/file/visual.c
--- 2130/degas/lib/libggi/display/file/visual.c Sat Jan 30 07:08:17 1999
+++ degas/lib/libggi/display/file/visual.c  Sun Feb  6 20:48:51 2000
@@ -33,14 +33,21 @@
 #include ggi/internal/ggi-dl.h
 #include ggi/display/file.h
 
-#define NUM_OPTS  3
-static gg_option file_options[NUM_OPTS] =
+static gg_option file_options[] =
 {
{ "flushcmd", "" },
{ "flushframe",  "0" },
{ "flushtime",  "0.0" }
 };
 
+#define OPT_FLUSHCMD   0
+#define OPT_FLUSHFRAME 1
+#define OPT_FLUSHTIME  2
+
+#define NUM_OPTS   (sizeof(file_options)/sizeof(gg_option))
+
+
+
 int GGIdlinit(ggi_visual *vis, const char *args,void *argptr)
 {
FileHook *ff;
@@ -87,9 +94,9 @@
}
 
ff-filename   = strdup(args);
-   ff-flushcmd   = file_options[0].result[0] ? strdup(file_options[0].result) : 
NULL;
-   ff-flushevery = atoi(file_options[1].result);
-   fltime = atof(file_options[2].result);
+   ff-flushcmd   = file_options[OPT_FLUSHCMD].result[0] ? 
+strdup(file_options[OPT_FLUSHCMD].result) : NULL;
+   ff-flushevery = atoi(file_options[OPT_FLUSHFRAME].result);
+   fltime = atof(file_options[OPT_FLUSHTIME].result);
ff-flushcnt   = 0;
ff-flushtotal = 0;
gettimeofday(ff-flushlast,NULL);



default shared lib extensions

2000-02-26 Thread John Fortin

Hi all,

Next on my list of idiosyncrasies for the windows port is the default
shared lib extension.  On windows it should be *.dll.  However, the
configure.in sets it to .so.  

Is there a way to have it determine the correct extension, or add a
command-line to configure to change this?

Thanks,
John Fortin



Re: [patch]: file-target fixes

2000-02-26 Thread Andreas Beck

 I have created a patch (attached), which fixes one typo error, some
 little/big-endian -stuff and also does some cleanups.
 Is anyone here to get the patch into the cvs-tree?

I will commit it, though with the following changes:

  void _ggi_file_write_word(ggi_visual *vis, int val)
  {
 +#ifdef GGI_LITTLE_ENDIAN
   _ggi_file_write_byte(vis, val  8);
   _ggi_file_write_byte(vis, val  0xFF);
 +#else
 + _ggi_file_write_byte(vis, val  0xFF);
 + _ggi_file_write_byte(vis, val  8);
 +#endif
  }

That is nonsense IMHO. If a fileformat has LE or BE words will rarely change
depending on the architecture we are running on. I split the function to
two:

void _ggi_file_write_BE_word(ggi_visual *vis, int val)
{
_ggi_file_write_byte(vis, (val  8)  0xff);
_ggi_file_write_byte(vis, val  0xff);
}

void _ggi_file_write_LE_word(ggi_visual *vis, int val)
{
_ggi_file_write_byte(vis, val  0xff);
_ggi_file_write_byte(vis, (val  8)  0xff);
}

CU, ANdy

-- 
= Andreas Beck|  Email :  [EMAIL PROTECTED] =



Re: [patch]: file-target fixes

2000-02-26 Thread Christoph Egger



On Sat, 26 Feb 2000, Andreas Beck wrote:

  I have created a patch (attached), which fixes one typo error, some
  little/big-endian -stuff and also does some cleanups.
  Is anyone here to get the patch into the cvs-tree?
 
 I will commit it, though with the following changes:
 
   void _ggi_file_write_word(ggi_visual *vis, int val)
   {
  +#ifdef GGI_LITTLE_ENDIAN
  _ggi_file_write_byte(vis, val  8);
  _ggi_file_write_byte(vis, val  0xFF);
  +#else
  +   _ggi_file_write_byte(vis, val  0xFF);
  +   _ggi_file_write_byte(vis, val  8);
  +#endif
   }
 
 That is nonsense IMHO. If a fileformat has LE or BE words will rarely change
 depending on the architecture we are running on. I split the function to
 two:
 
 void _ggi_file_write_BE_word(ggi_visual *vis, int val)
 {
 _ggi_file_write_byte(vis, (val  8)  0xff);
 _ggi_file_write_byte(vis, val  0xff);
 }
 
 void _ggi_file_write_LE_word(ggi_visual *vis, int val)
 {
 _ggi_file_write_byte(vis, val  0xff);
 _ggi_file_write_byte(vis, (val  8)  0xff);
 }

OK - I agree.


Christoph Egger
E-Mail: [EMAIL PROTECTED]