busting sp datatypes

This is a discussion on busting sp datatypes within the Fortran forums in Programming Languages category; Richard Maine wrote: > Anyway, I took a quick look at the particular case you mentioned and I > verified that the braces are missing from that example. This seems very > likely to be a typesetting error. Note that braces need special > attention in LaTex (which is used fo rthe standard), which makes such an > error particularly plausuble. Those braces were in the f2003 standard. I used to have a TeX macro that would allow inclusion of text using a typewriter font and retaining blanks, line breaks, and including braces. It requires one character that isn't used ...

Go Back   Application Development Forum > Programming Languages > Fortran

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #41  
Old 09-02-2008, 03:37 PM
glen herrmannsfeldt
Guest
 
Default Re: busting sp datatypes

Richard Maine wrote:

> Anyway, I took a quick look at the particular case you mentioned and I
> verified that the braces are missing from that example. This seems very
> likely to be a typesetting error. Note that braces need special
> attention in LaTex (which is used fo rthe standard), which makes such an
> error particularly plausuble. Those braces were in the f2003 standard.


I used to have a TeX macro that would allow inclusion of text
using a typewriter font and retaining blanks, line breaks, and
including braces. It requires one character that isn't used
in the included text to close the block. A non-printing control
character can be used if needed.

-- glen

Reply With Quote
  #42  
Old 09-07-2008, 12:41 AM
David Thompson
Guest
 
Default Re: busting sp datatypes

On Fri, 29 Aug 2008 11:55:02 -0600, "James Van Buskirk"
<not_valid@comcast.net> wrote:

> Possible implementation:


> interface
> subroutine qsort(BasePtr, NoOfElements, Width, cmp_func) bind(C)
> use ISO_C_BINDING
> ! import my_cmp_func ! doesn't work
> type(C_PTR), value :: BasePtr
> integer(C_SHORT), value :: NoOfElements
> integer(C_SHORT), value :: Width


Those two should be C_SIZE_T. There are many systems where these are
different sizes, although probably fewer where it makes a difference
to the (by-value) calling convention (and thus fails detectably).

> interface
> function cmp_func(elem1, elem2) bind(C)
> use ISO_C_BINDING
> integer(C_LONG) cmp_func


Similarly C_INT; there are probably fewer (but still some) where these
differ in size, and very few where it makes a difference.

> type(C_PTR), value :: elem1
> type(C_PTR), value :: elem2
> end function cmp_func
> end interface
> ! procedure(my_cmp_func) cmp_func ! doesn't work
> end subroutine qsort
> end interface

<snip rest>

- formerly david.thompson1 || achar(64) || worldnet.att.net
Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 02:31 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.