Moderator: Andres Valverde
Jos? Carlos wrote:From my point of view, there's no problem as long as you give credit to Tord. You said you'll do, so IMO it is fine that you use the code (of course if Tord gives you permission).
It is possible that it could be a problem if you enter a world champs, where the rules say no code from other programs, but many people use EGTBs code from Nalimov, and that doesn't seem to be a problem...
Uri Blass wrote:I am considering to support UCI and I want to know if I am allowed to copy code in glaurung1.5 that supports UCI(I plan to mention tord in notes about it and release the relevant code)
I could ask by email but I think that it may be relevant also for other programmers.
I am talking about the files
strcase.c and part of the file uci.c
Uri Blass wrote:I am talking about the files
strcase.c and part of the file uci.c
Dieter B?r?ner wrote:Tord, just some minor pedantic nit pickings. Portable code should not define functions str[a-z]..., that are not defined in the ISO C-Standard. Neither should maximal portable code use such functions. These names are reserverd. Using names like str_casecmp (the underscore makes the difference) is safe, however. I did not look at your source, so I cannot judge, how you really use it.
#if defined(UNIX)
# define str_casecmp strcasecmp
# define str_ncasecmp strncasecmp
#endif
Tord Romstad wrote:I appreciate your nit pickings. I have never really learned the C programming language, and as a consequence I program in a mixture of ANSI C, GNU-specific extensions, and Unix system calls, without really knowing what is what. When I wrote my code, I thought the strncasecmp function was part of the standard C library. Evidently I was wrong. I suppose I should add something like;
- Code: Select all
#if defined(UNIX)
# define str_casecmp strcasecmp
# define str_ncasecmp strncasecmp
#endif
to my header file, and at the same time change the names of the functions in Dann's strcase.c file.
Tord
Dieter B?r?ner wrote:Tord Romstad wrote:I appreciate your nit pickings. I have never really learned the C programming language, and as a consequence I program in a mixture of ANSI C, GNU-specific extensions, and Unix system calls, without really knowing what is what. When I wrote my code, I thought the strncasecmp function was part of the standard C library. Evidently I was wrong. I suppose I should add something like;
- Code: Select all
#if defined(UNIX)
# define str_casecmp strcasecmp
# define str_ncasecmp strncasecmp
#endif
to my header file, and at the same time change the names of the functions in Dann's strcase.c file.
Tord
Really, I am very pedantic I guess, when you compile your code with strictest Standard C conformance flags, this still can have problems. Under these conditions the compiler may choose to hide strcasecmp from string.h. Also, of course, the compiler will not define UNIX then (I guess you are aware of this).
Anyway, this really is too much nit picking. I did not look at your code yet. When I looked at free code earlier, I was always a bit dissapointed. I am convinced, that it is possible to write a decent chess engine in pure Standard C, with the exception of very few routines (only timing code and input polling comes to my mind), that can be well seperated. In a learning engine, I think it would be nice to have Standard C. When I first looked at TSCP: it assumes 32 bit int, IIRC also some issues with signedness, etc. Things that are not guaranteed in Standard C (but of course will work under most environments nowadays, although at that time I still used old Borland C 3.5, under which TSCP would not work, and it would be quite some effort to make it work).
BTW. For what do you need strcasecmp (in the context of UCI)? Aren't UCI commands case sensitive?
Uri Blass wrote:programmers do not need to invent everything and can use library functions that other people invented.
Return to Programming and Technical Discussions
Users browsing this forum: No registered users and 6 guests