Opened 10 years ago

Closed 10 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 by martinl, 10 years ago

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

comment:2 by martinl, 10 years ago

Description: modified (diff)

comment:3 by martinl, 10 years ago

Keywords: cdhclib prefix added; cdhc removed

comment:4 by wenzeslaus, 10 years ago

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

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

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

in reply to:  5 comment:6 by wenzeslaus, 10 years ago

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.

in reply to:  description ; comment:7 by neteler, 10 years ago

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.

in reply to:  7 comment:8 by martinl, 10 years ago

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.