* include/hbdefs.h
+ Adjusted HB_SIZE_MAX value for Win64 after recent changes.
* src/vm/hashfunc.c
* src/vm/hvm.c
* src/debug/dbgentry.c
* src/common/hbwin.c
* src/common/hbfsapi.c
* src/common/hbstr.c
* src/rtl/lennum.c
* src/rtl/hbzlibgz.c
* src/rtl/hbtoken.c
* src/rtl/hbmd5.c
* src/rtl/hbregex.c
* src/rtl/hbzlib.c
* src/rtl/gtpca/gtpca.c
* contrib/hbct/screen2.c
* contrib/hbct/token2.c
* contrib/hbct/charsprd.c
* contrib/hbct/charlist.c
* contrib/hbct/charsort.c
* contrib/hbct/maxline.c
* contrib/hbct/wordrepl.c
* contrib/hbct/charrepl.c
* contrib/hbct/charswap.c
* contrib/hbct/pos1.c
* contrib/hbct/token1.c
* contrib/hbct/charmirr.c
* contrib/hbct/relation.c
* contrib/hbct/atnum.c
* contrib/hbct/count.c
* contrib/hbct/ctstrfil.c
* contrib/hbct/posdiff.c
* contrib/hbct/addascii.c
* contrib/hbct/pos2.c
* contrib/hbct/numat.c
* contrib/hbct/atrepl.c
* contrib/hbct/print.c
* contrib/xhb/txtline.c
* contrib/hbgt/strright.c
* contrib/hbgt/chrtotal.c
* contrib/hbgt/strcount.c
* contrib/hbgt/ascposgt.c
* contrib/hbgt/strleft.c
* contrib/hbgt/chrcount.c
* contrib/hbgt/strcspn.c
* contrib/hbgt/atdiff.c
* contrib/hbbz2/hbbz2.c
* contrib/hbmemio/memio.c
* contrib/hbclipsm/num.c
* contrib/hbclipsm/date.c
* contrib/hbmisc/stringsx.c
* contrib/hbmisc/spd.c
+ Using new size API.
NOTE: This will be a longer process as there many current variations
to pass sizes (*nint(), *ni(), *nl()) and there is no warning
issued in several of these.
Please also note that not all updates files became fully clean.
I will post a list of remaining warnings.
+ Type cleanup:
int -> HB_ISIZ
+ Added casts at component boundaries.
% Deleted unnecessary '( HB_SIZE )' casts.
+ ULONG_MAX -> HB_SIZE_MAX
* 'hb_retl( 0 )' -> 'hb_retl( HB_FALSE )'
* 'hb_retl( 1 )' -> 'hb_retl( HB_TRUE )'
! CSETSAFETY() fixed to return and accept logical parameters
instead of returning numeric, checking for logical but retrieving
numeric.
* src/common/hbwin.c
* DWORD -> int to be in sync with Windows API declarations.
; NOTE: I left out RDDs and VM from the areas I scanned, please
modify them. F.e. we will need a hb_vmPushSize().
; Peer review (by as much eyeballs as possible) is appreciated.
50 lines
955 B
C
50 lines
955 B
C
/*
|
|
* $Id$
|
|
*/
|
|
|
|
/*
|
|
* GT CLIPPER STANDARD HEADER
|
|
*
|
|
* File......: atdiff.c
|
|
* Author....: Andy M Leighton
|
|
* BBS.......: The Dark Knight Returns
|
|
* Net/Node..: 050/069
|
|
* User Name.: Andy Leighton
|
|
* Date......: 23/05/93
|
|
* Revision..: 1.00
|
|
*
|
|
* This is an original work by Andy Leighton and is placed in the
|
|
* public domain.
|
|
*/
|
|
|
|
#include "hbapi.h"
|
|
|
|
HB_FUNC( GT_ATDIFF )
|
|
{
|
|
const char *s1, *s2;
|
|
HB_ISIZ pos, len;
|
|
|
|
if (HB_ISCHAR(1) && HB_ISCHAR(2)) {
|
|
s1 = hb_parc(1);
|
|
s2 = hb_parc(2);
|
|
len = hb_parclen(2);
|
|
|
|
/*
|
|
loop through comparing both strings
|
|
|
|
NOTE: pos starts at 1, so as to return a string index
|
|
for CLIPPER
|
|
*/
|
|
|
|
for (pos = 1; (pos <= len) && (*s1 == *s2); s2++, s1++)
|
|
pos++;
|
|
|
|
if (pos > len) /* strings match exactly!!! */
|
|
hb_retns(0);
|
|
else
|
|
hb_retns(pos);
|
|
} else {
|
|
hb_retns(-1); /* parameter mismatch - error -1 */
|
|
}
|
|
}
|