Re: [Ql-Users] qxltool and qltols

2015-10-09 Thread Norman Dunbar

On 08/10/15 19:07, Graeme Gregory wrote:


Fixed qltools is here

https://github.com/slimlogic/qltools


Thanks Graeme, I've been looking for a decent version of qltools for 
some time to use on Linux.


David - if you are interested - the reason that qltools.c won't compile 
without warnings on Linux is because the original code used various 
typdefs from stdint.h, which, for example, defines the following:


typedef unsigned intuint32_t;

So, the unit32_t assumes that an unsigned int is 32 bits.

The C99 standard introduced those as actual types so that a uint32_t is 
always guaranteed (!) to be 32 bits. In order to printf() those, this 
now gives a warning:


printf ("Updates : %ld\n", swaplong (b0->q5a_mupd));

simply because the "%ld" is the format specifier for a long int and not 
for a uint32_t. In order to get rid of the warnings, you need to either:


#include 
...
printf ("Updates : %" PRIu32 "\n", swaplong (b0->q5a_mupd));


or, simply change the "%ld" specifier to "%u" for a simple unsigned int.


I think the later/latest versions of gcc defaults to c99, hence all the 
warnings.


I'm in the middle of going through one of my old programs on Linux to 
replace all the "%lu" etc with the appropriate c99 specifiers rather 
than just making them all "%u". It should then be future proof! Famous 
last words.



HTH

Cheers,
Norm.


--
Norman Dunbar
Dunbar IT Consultants Ltd

Registered address:
27a Lidget Hill
Pudsey
West Yorkshire
United Kingdom
LS28 7LG

Company Number: 05132767
___
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm


Re: [Ql-Users] qxltool and qltols

2015-10-09 Thread David Gilham
Thanks Norman You have also given a hint fo qxltools.
I am using Gcc v 4.8.4 on my box and will ateempt to modify qxltools unless
someone else has done so already.


On 9 October 2015 at 13:29, Norman Dunbar  wrote:

> On 09/10/15 12:39, Graeme Gregory wrote:
>
>>
>> I have replied to your pull request through github. Some some small
>> comments.
>>
>> Ok, they are fixed now, I'll sort out another pull request.
>
> Addressing one of your other comments on github publically here you can
>> use linux to generate the windows version (as I did for dilwyns page)
>> using the mingw compiler. You should find it packaged on most modern
>> linux systems. Its far easier than trying to make the code compile in
>> Visual Studio.
>>
>> make CC=i686-w64-mingw32-gcc
>>
>
> Well, that opened another can of worms! It seems that under Windows
> getch() is deprecated and "this API cannot be used in the Windows
> environment" - use _getch() instead. Either that, or, they need to #include
>  to avoid the following:
>
> ../qltools.c: In function ‘writefile’:
> ../qltools.c:1330:7: warning: implicit declaration of function ‘getch’
> [-Wimplicit-function-declaration]
>OWopt = getch ();
>
>
> Linux is happy enough without conio, which is just as well as it's not
> there in Unix anyway!
>
> For Windows we need either the #include or just a simple int getch()
> forward declaration somewhere. I'm not sure what is #defined in Windows
> these days, so I've left that well alone for now.
>
> Also, using the mingw compiler, it seems that now dev is flagged as
> unused. Sigh!
>
> ../qltools.c:1845:14: warning: unused variable ‘dev’ [-Wunused-variable]
>  char *pd,dev[64];
>
> However, as it is used within a couple of #ifdefs relating to __NT__ and
> __linux__ I suspect it's because I'm effectively cross compiling. It should
> (!) be ok on Windows itself.
>
>
> Cheers,
> Norm.
>
> --
> Norman Dunbar
> Dunbar IT Consultants Ltd
>
> Registered address:
> 27a Lidget Hill
> Pudsey
> West Yorkshire
> United Kingdom
> LS28 7LG
>
> Company Number: 05132767
> ___
> QL-Users Mailing List
> http://www.q-v-d.demon.co.uk/smsqe.htm
>



-- 
David Gilham
The Universe is a queer place
___
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm

Re: [Ql-Users] qxltool and qltols

2015-10-09 Thread Graeme Gregory


On Fri, 9 Oct 2015, at 04:51 PM, Norman Dunbar wrote:
> On 09/10/15 16:47, David Gilham wrote:
> > Thanks Norman You have also given a hint fo qxltools.
> > I am using Gcc v 4.8.4 on my box and will ateempt to modify qxltools unless
> > someone else has done so already.
> 
> Hi David,
> 
> I've not made any changes to the qxltools on the grounds that I don't, 
> probably, have the most recent source. If someone does have an updated 
> version, we should/could/must put it on github as well, I suppose, to be 
> sure that we all sing from the same source code!
> 
Same here and I also have no QXL.win files to play with!

Graeme
___
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm


Re: [Ql-Users] qxltool and qltols

2015-10-09 Thread Norman Dunbar

On 09/10/15 16:47, David Gilham wrote:

Thanks Norman You have also given a hint fo qxltools.
I am using Gcc v 4.8.4 on my box and will ateempt to modify qxltools unless
someone else has done so already.


Hi David,

I've not made any changes to the qxltools on the grounds that I don't, 
probably, have the most recent source. If someone does have an updated 
version, we should/could/must put it on github as well, I suppose, to be 
sure that we all sing from the same source code!



Cheers,
Norm.

--
Norman Dunbar
Dunbar IT Consultants Ltd

Registered address:
27a Lidget Hill
Pudsey
West Yorkshire
United Kingdom
LS28 7LG

Company Number: 05132767
___
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm


Re: [Ql-Users] qxltool and qltols

2015-10-09 Thread Norman Dunbar

On 09/10/15 09:43, Norman Dunbar wrote:

On 08/10/15 19:07, Graeme Gregory wrote:


Fixed qltools is here

https://github.com/slimlogic/qltools


Thanks Graeme, I've been looking for a decent version of qltools for
some time to use on Linux.



Given that I had a bit of time this morning while the alarm man was here 
to service our alarm, I had a look at the code and I've updated it to 
compile without warnings on Linux - well, 64 bit anyway.


I've forked Graeme's Git repository and made the changes there. I've 
created a pull request to have the changes merged back into Graeme's 
repo at his leisure.


If you want or need the new version, it's available at:

https://github.com/NormanDunbar/qltools.git

or, you can get the latest source as a zip file from:

https://github.com/NormanDunbar/qltools/archive/master.zip

HTH


Cheers,
Norm.


--
Norman Dunbar
Dunbar IT Consultants Ltd

Registered address:
27a Lidget Hill
Pudsey
West Yorkshire
United Kingdom
LS28 7LG

Company Number: 05132767
___
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm


Re: [Ql-Users] qxltool and qltols

2015-10-09 Thread Graeme Gregory


On Fri, 9 Oct 2015, at 11:43 AM, Norman Dunbar wrote:
> On 09/10/15 09:43, Norman Dunbar wrote:
> > On 08/10/15 19:07, Graeme Gregory wrote:
> >
> >> Fixed qltools is here
> >>
> >> https://github.com/slimlogic/qltools
> >
> > Thanks Graeme, I've been looking for a decent version of qltools for
> > some time to use on Linux.
> >
> 
> Given that I had a bit of time this morning while the alarm man was here 
> to service our alarm, I had a look at the code and I've updated it to 
> compile without warnings on Linux - well, 64 bit anyway.
> 
> I've forked Graeme's Git repository and made the changes there. I've 
> created a pull request to have the changes merged back into Graeme's 
> repo at his leisure.
> 
> If you want or need the new version, it's available at:
> 
> https://github.com/NormanDunbar/qltools.git
> 
> or, you can get the latest source as a zip file from:
> 
> https://github.com/NormanDunbar/qltools/archive/master.zip
> 
I have replied to your pull request through github. Some some small
comments.

Addressing one of your other comments on github publically here you can
use linux to generate the windows version (as I did for dilwyns page)
using the mingw compiler. You should find it packaged on most modern
linux systems. Its far easier than trying to make the code compile in
Visual Studio.

make CC=i686-w64-mingw32-gcc

Graeme
___
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm


Re: [Ql-Users] qxltool and qltols

2015-10-09 Thread Graeme Gregory


On Fri, 9 Oct 2015, at 01:29 PM, Norman Dunbar wrote:
> On 09/10/15 12:39, Graeme Gregory wrote:
> >
> > I have replied to your pull request through github. Some some small
> > comments.
> >
> Ok, they are fixed now, I'll sort out another pull request.
> 
> > Addressing one of your other comments on github publically here you can
> > use linux to generate the windows version (as I did for dilwyns page)
> > using the mingw compiler. You should find it packaged on most modern
> > linux systems. Its far easier than trying to make the code compile in
> > Visual Studio.
> >
> > make CC=i686-w64-mingw32-gcc
> 
> Well, that opened another can of worms! It seems that under Windows 
> getch() is deprecated and "this API cannot be used in the Windows 
> environment" - use _getch() instead. Either that, or, they need to 
> #include  to avoid the following:
> 
> ../qltools.c: In function ‘writefile’:
> ../qltools.c:1330:7: warning: implicit declaration of function ‘getch’ 
> [-Wimplicit-function-declaration]
> OWopt = getch ();
> 
> 
> Linux is happy enough without conio, which is just as well as it's not 
> there in Unix anyway!
> 
> For Windows we need either the #include or just a simple int getch() 
> forward declaration somewhere. I'm not sure what is #defined in Windows 
> these days, so I've left that well alone for now.
> 
> Also, using the mingw compiler, it seems that now dev is flagged as 
> unused. Sigh!
> 
> ../qltools.c:1845:14: warning: unused variable ‘dev’ [-Wunused-variable]
>   char *pd,dev[64];
> 
> However, as it is used within a couple of #ifdefs relating to __NT__ and 
> __linux__ I suspect it's because I'm effectively cross compiling. It 
> should (!) be ok on Windows itself.
> 
I just noticed that issue, I don't think that occurred with an old mingw
so I think the __NT__ define has changed. Ill look into it later today.

Graeme
___
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm

Re: [Ql-Users] qxltool and qltols

2015-10-09 Thread Norman Dunbar

On 09/10/15 12:39, Graeme Gregory wrote:


I have replied to your pull request through github. Some some small
comments.


Ok, they are fixed now, I'll sort out another pull request.


Addressing one of your other comments on github publically here you can
use linux to generate the windows version (as I did for dilwyns page)
using the mingw compiler. You should find it packaged on most modern
linux systems. Its far easier than trying to make the code compile in
Visual Studio.

make CC=i686-w64-mingw32-gcc


Well, that opened another can of worms! It seems that under Windows 
getch() is deprecated and "this API cannot be used in the Windows 
environment" - use _getch() instead. Either that, or, they need to 
#include  to avoid the following:


../qltools.c: In function ‘writefile’:
../qltools.c:1330:7: warning: implicit declaration of function ‘getch’ 
[-Wimplicit-function-declaration]

   OWopt = getch ();


Linux is happy enough without conio, which is just as well as it's not 
there in Unix anyway!


For Windows we need either the #include or just a simple int getch() 
forward declaration somewhere. I'm not sure what is #defined in Windows 
these days, so I've left that well alone for now.


Also, using the mingw compiler, it seems that now dev is flagged as 
unused. Sigh!


../qltools.c:1845:14: warning: unused variable ‘dev’ [-Wunused-variable]
 char *pd,dev[64];

However, as it is used within a couple of #ifdefs relating to __NT__ and 
__linux__ I suspect it's because I'm effectively cross compiling. It 
should (!) be ok on Windows itself.



Cheers,
Norm.

--
Norman Dunbar
Dunbar IT Consultants Ltd

Registered address:
27a Lidget Hill
Pudsey
West Yorkshire
United Kingdom
LS28 7LG

Company Number: 05132767
___
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm


Re: [Ql-Users] qxltool and qltols

2015-10-09 Thread Graeme Gregory


On Fri, 9 Oct 2015, at 01:35 PM, Graeme Gregory wrote:
> 
> 
> On Fri, 9 Oct 2015, at 01:29 PM, Norman Dunbar wrote:
> > On 09/10/15 12:39, Graeme Gregory wrote:
> > >
> > > I have replied to your pull request through github. Some some small
> > > comments.
> > >
> > Ok, they are fixed now, I'll sort out another pull request.
> > 
> > > Addressing one of your other comments on github publically here you can
> > > use linux to generate the windows version (as I did for dilwyns page)
> > > using the mingw compiler. You should find it packaged on most modern
> > > linux systems. Its far easier than trying to make the code compile in
> > > Visual Studio.
> > >
> > > make CC=i686-w64-mingw32-gcc
> > 
> > Well, that opened another can of worms! It seems that under Windows 
> > getch() is deprecated and "this API cannot be used in the Windows 
> > environment" - use _getch() instead. Either that, or, they need to 
> > #include  to avoid the following:
> > 
> > ../qltools.c: In function ‘writefile’:
> > ../qltools.c:1330:7: warning: implicit declaration of function ‘getch’ 
> > [-Wimplicit-function-declaration]
> > OWopt = getch ();
> > 
> > 
> > Linux is happy enough without conio, which is just as well as it's not 
> > there in Unix anyway!
> > 
> > For Windows we need either the #include or just a simple int getch() 
> > forward declaration somewhere. I'm not sure what is #defined in Windows 
> > these days, so I've left that well alone for now.
> > 
> > Also, using the mingw compiler, it seems that now dev is flagged as 
> > unused. Sigh!
> > 
> > ../qltools.c:1845:14: warning: unused variable ‘dev’ [-Wunused-variable]
> >   char *pd,dev[64];
> > 
> > However, as it is used within a couple of #ifdefs relating to __NT__ and 
> > __linux__ I suspect it's because I'm effectively cross compiling. It 
> > should (!) be ok on Windows itself.
> > 
> I just noticed that issue, I don't think that occurred with an old mingw
> so I think the __NT__ define has changed. Ill look into it later today.
> 
Hi Norman,

Should be fixed now, have tested the resulting .exe on windows and it
seems to work.

Was just missing a couple of #if defined(__MINGW32__)

Graeme
___
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm

Re: [Ql-Users] qxltool and qltols

2015-10-09 Thread Norman Dunbar

On 09/10/15 14:16, Graeme Gregory wrote:


Hi Norman,

Should be fixed now, have tested the resulting .exe on windows and it
seems to work.

Was just missing a couple of #if defined(__MINGW32__)

Graeme


Good stuff, thanks.


Cheers,
Norm.

--
Norman Dunbar
Dunbar IT Consultants Ltd

Registered address:
27a Lidget Hill
Pudsey
West Yorkshire
United Kingdom
LS28 7LG

Company Number: 05132767
___
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm


Re: [Ql-Users] qxltool and qltols

2015-10-08 Thread Graeme Gregory


On Thu, 8 Oct 2015, at 07:03 PM, David Gilham wrote:
> It would seem that the versions of the above in the Distribution archive
> though the compile with warnings under linex on a ^4 bit amd platform
> they do not seem to function properly. I am trying them on 64 bit Linux
> on an IBM Thinkpad. Has anyone else either fixed them or has pointers
> to how to fix them.
> 
Fixed qltools is here

https://github.com/slimlogic/qltools

Graeme
___
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm


[Ql-Users] qxltool and qltols

2015-10-08 Thread David Gilham
It would seem that the versions of the above in the Distribution archive
though the compile with warnings under linex on a ^4 bit amd platform
they do not seem to function properly. I am trying them on 64 bit Linux
on an IBM Thinkpad. Has anyone else either fixed them or has pointers
to how to fix them.

-- 
David Gilham
The Universe is a queer place
___
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm