#2421: Functions from CDHC have no prefix
-------------------------+--------------------------------------------------
Reporter: martinl | Owner: grass-dev@…
Type: task | Status: new
Priority: blocker | Milestone: 7.0.0
Component: Default | Version: svn-trunk
Keywords: cdhc, api | Platform: Unspecified
Cpu: Unspecified |
-------------------------+--------------------------------------------------
In contrast to other GRASS libs, CDHC lib (1) doesn't use by prefix. I
would suggest to change eg.
I'm pretty sure that it is the same as writing just `.6872` but one never
knows with C.
For the other functions which might be similar case as cdhclib, we might
try to go through the elements in
[http://grass.osgeo.org/programming7/globals.html Globals section in
manual] but I'm not sure if all the things in the manual are public API, I
think they should be according to the Doxyfile settings:
{{{
EXTRACT_PRIVATE = NO
EXTRACT_STATIC = NO
...
}}}
> I'm pretty sure that it is the same as writing just `.6872`
Yes (although a leading zero is preferable, i.e. "0.6872").
A floating-point literal with no suffix has type "double". A suffix of "f"
or "F" makes the type "float". In C99 and later, a suffix of "l" or "L"
makes the type "long double"
It may be that the code was converted from another language using a
converter which always adds an explicit cast. Or it may have been
maintained by someone relatively unfamiliar with C who added the cast
"just to be sure".
#2421: Functions from CDHC lib have no prefix
----------------------------------+-----------------------------------------
Reporter: martinl | Owner: grass-dev@…
Type: task | Status: new
Priority: blocker | Milestone: 7.0.0
Component: Default | Version: svn-trunk
Keywords: cdhclib, api, prefix | Platform: Unspecified
Cpu: Unspecified |
----------------------------------+-----------------------------------------
Comment(by wenzeslaus):
Replying to [comment:5 glynn]:
> Replying to [comment:4 wenzeslaus]:
>
> > Even more by the way, does the
[http://grass.osgeo.org/programming7/shapiro1_8c_source.html#l00032
following syntax] mean something special?
> >
> {{{
> (double).6872
> }}}
>
> No.
>
> > I'm pretty sure that it is the same as writing just `.6872`
>
> Yes (although a leading zero is preferable, i.e. "0.6872").
>
> A floating-point literal with no suffix has type "double". A suffix of
"f" or "F" makes the type "float". In C99 and later, a suffix of "l" or
"L" makes the type "long double"
>
> It may be that the code was converted from another language using a
converter which always adds an explicit cast. Or it may have been
maintained by someone relatively unfamiliar with C who added the cast
"just to be sure".
Thanks for the answer, I also wanted to be sure that I understand.
#2421: Functions from CDHC lib have no prefix
----------------------------------+-----------------------------------------
Reporter: martinl | Owner: grass-dev@…
Type: task | Status: new
Priority: blocker | Milestone: 7.0.0
Component: Default | Version: svn-trunk
Keywords: cdhclib, api, prefix | Platform: Unspecified
Cpu: Unspecified |
----------------------------------+-----------------------------------------
Comment(by neteler):
Replying to [ticket:2421 martinl]:
> In contrast to other GRASS libs, CDHC lib (1) doesn't use any prefix. I
would suggest to change eg.
>
> {{{
> anderson_darling()
> }}}
>
> to
>
> {{{
> Cdhc_anderson_darling()
> }}}
Updated in trunk in r62130. Please check. If ok, it can be backported.