Opened 5 years ago

Closed 5 years ago

#2421 closed task (fixed)

Functions from CDHC lib have no prefix

Reported by: martinl Owned by: grass-dev@…
Priority: blocker Milestone: 7.0.0
Component: Default Version: svn-trunk
Keywords: cdhclib, api, prefix Cc:
CPU: Unspecified Platform: Unspecified

Description (last modified by 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()

Any option? Marked as blocker since it's API change.

(1) http://grass.osgeo.org/programming7/cdhclib.html

Change History (8)

comment:1 Changed 5 years ago by martinl

Description: modified (diff)
Summary: Functions from CDHC have no prefixFunctions from CDHC lib have no prefix

comment:2 Changed 5 years ago by martinl

Description: modified (diff)

comment:3 Changed 5 years ago by martinl

Keywords: cdhclib prefix added; cdhc removed

comment:4 Changed 5 years ago by wenzeslaus

Agreed, they should use prefix.

BTW, if somebody knows something about it, please go ahead and write some documentation, there is none.

Even more by the way, does the following syntax mean something special?

(double).6872

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 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
...

comment:5 in reply to:  4 ; Changed 5 years ago by glynn

Replying to wenzeslaus:

Even more by the way, does the 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".

comment:6 in reply to:  5 Changed 5 years ago by wenzeslaus

Replying to glynn:

Replying to wenzeslaus:

Even more by the way, does the 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.

comment:7 in reply to:  description ; Changed 5 years ago by neteler

Replying to 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.

comment:8 in reply to:  7 Changed 5 years ago by martinl

Resolution: fixed
Status: newclosed

Replying to neteler:

Updated in trunk in r62130. Please check. If ok, it can be backported.

Seems to be OK to me. Thanks for solving this issue. I took liberty to backport it (r62207) and to close the ticket.

Note: See TracTickets for help on using tickets.