- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
I am trying to improve my code by adding checking for integer overflow.
I now find I get an integer overflow error with the RGB function.
I must be doing something silly.
David
I now find I get an integer overflow error with the RGB function.
I must be doing something silly.
David
integer*4 c integer*2 i1,i2,i3 c=RGB(255,0,0) ! this is OK i1=255 i2=0 i3=0 c=RGB(int1(i1),int1(i2),int1(i3)) ! this gives and error
- Balises:
- Intel® Fortran Compiler
Lien copié
4 Réponses
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
A simple write statement shows that int1(255)=-1.
I don't see explicit documenation of RGB() called ffom Fortran.
Would it be easier to use RGBTOINTEGER which explicity has integer*4 arguments and check bitwise that the higher bits are not set?
I don't see explicit documenation of RGB() called ffom Fortran.
Would it be easier to use RGBTOINTEGER which explicity has integer*4 arguments and check bitwise that the higher bits are not set?
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
Thanks, I had forgotten that int1 would be -127 to 128.
When I try RGBtoInteger it won't compile, I don't see why.
I get the message 'Unresolved external symbol _rgbtointeger
David
When I try RGBtoInteger it won't compile, I don't see why.
I get the message 'Unresolved external symbol _rgbtointeger
David
use dfwin use dflib integer*4 i1,i2,i3,c c=RGB(255,0,0) ! this is OK i1=255 i2=0 i3=0 c=RGBTOINTEGER(i1,i2,i3) ! this wouldn't compile
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
The message you quote looks like an error message from the linker. Your code compiled and linked OK for me in a fresh "standard graphics" project. Perhaps you are not accessing the right library?
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
I thought using -
'Use dflib' would use the correct library.
How can I check this. Normally it works OK.
David
'Use dflib' would use the correct library.
How can I check this. Normally it works OK.
David
Répondre
Options du sujet
- S'abonner au fil RSS
- Marquer le sujet comme nouveau
- Marquer le sujet comme lu
- Placer ce Sujet en tête de liste pour l'utilisateur actuel
- Marquer
- S'abonner
- Page imprimable