[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference hydra::amiga_v1

Title:AMIGA NOTES
Notice:Join us in the *NEW* conference - HYDRA::AMIGA_V2
Moderator:HYDRA::MOORE
Created:Sat Apr 26 1986
Last Modified:Wed Feb 05 1992
Last Successful Update:Fri Jun 06 1997
Number of topics:5378
Total number of notes:38326

542.0. "PTR/INT conversion warnings" by KIRK::LONG () Wed Jun 10 1987 09:41

 I seem to be having some problems with Manx C 3.40a.  I get warnings of PTR/INT
conversions that I supposedly don't have to worry about if my INT is the same
size as a PTR. 
Here a a couple of lines that will cause the warning (#121 I think):

   struct IntuitionBase *IntuitionBase;
   IntuitionBase=(struct IntuitionBase *)OpenLibrary("intuition.library",vers);

I have seen identical code in other's programs and have used the same switchs
when I compile but to no avail ( yeah, I know I can set a switch to give no
warnings ).

Anybody know how you avoid these warnings?

Thanks,
Dick 
T.RTitleUserPersonal
Name
DateLines
542.1COOKIE::WECKERDave (Cum Grano Salis) WeckerWed Jun 10 1987 18:5314
re:	.0

>   struct IntuitionBase *IntuitionBase;
>   IntuitionBase=(struct IntuitionBase *)OpenLibrary("intuition.library",vers);

The only things that I do different/in_addition are:

	1)	Make sure that you #include <functions.h> so that OpenLibrary
		has the right type. (Otherwise it will be a short int and
		won't type cast).

	2)	make sure vers is of type LONG.

dave
542.2Alternate suggestionsSQM::JMSYNGEJames M Synge, VMS Performance Anal.Fri Jun 12 1987 13:5118
	I find Manx's <functions.h> to be a real pain.  Some of the Amiga
	routines seem to have been mis-typed in the file.

	As a results, I always use code of the form

		struct Library *OpenLibrary();
		struct IntuitionBase *IntuitionBase;
		IntuitionBase =
		 (struct IntuitionBase *)OpenLibrary("intuition.library",vers);

	Alternately, you could specify OpenLibrary's type as

		struct IntuitionBase *OpenLibrary();

	if Intuition was the only library you were planning to open.

James Synge