Ignore:
Timestamp:
2012-02-28T13:59:00+13:00 (12 years ago)
Author:
kjdon
Message:

merged 64_bit_Greenstone branch into trunk, rev 25139

Location:
main/trunk/greenstone2/common-src/indexers/mg
Files:
112 edited
1 copied

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/common-src/indexers/mg/Makefile.in

    r22058 r25147  
    2828
    2929CC = @CC@
    30 CFLAGS = @CFLAGS@ @COMPAT32BITFLAGS@ -fpic
     30CFLAGS = @CFLAGS@ -fpic
    3131INSTALL = @INSTALL@
    3232INSTALL_DATA = @INSTALL_DATA@
    3333INSTALL_PROGRAM = @INSTALL_PROGRAM@
    34 LDFLAGS = @LDFLAGS@ @COMPAT32BITFLAGS@
     34LDFLAGS = @LDFLAGS@
    3535LIBS = @LIBS@ 
    3636TOUCH = echo timestamp >
  • main/trunk/greenstone2/common-src/indexers/mg/configure

    r23356 r25147  
    11#! /bin/sh
    22# Guess values for system-dependent variables and create Makefiles.
    3 # Generated by GNU Autoconf 2.67.
     3# Generated by GNU Autoconf 2.65.
    44#
    55#
    66# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
    7 # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
    8 # Foundation, Inc.
     7# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
     8# Inc.
    99#
    1010#
     
    317317    done
    318318    test -z "$as_dirs" || eval "mkdir $as_dirs"
    319   } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
     319  } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir"
    320320
    321321
     
    357357
    358358
    359 # as_fn_error STATUS ERROR [LINENO LOG_FD]
    360 # ----------------------------------------
     359# as_fn_error ERROR [LINENO LOG_FD]
     360# ---------------------------------
    361361# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
    362362# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
    363 # script with STATUS, using 1 if that was 0.
     363# script with status $?, using 1 if that was 0.
    364364as_fn_error ()
    365365{
    366   as_status=$1; test $as_status -eq 0 && as_status=1
    367   if test "$4"; then
    368     as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
    369     $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
     366  as_status=$?; test $as_status -eq 0 && as_status=1
     367  if test "$3"; then
     368    as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
     369    $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3
    370370  fi
    371   $as_echo "$as_me: error: $2" >&2
     371  $as_echo "$as_me: error: $1" >&2
    372372  as_fn_exit $as_status
    373373} # as_fn_error
     
    531531
    532532# Name of the host.
    533 # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
     533# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
    534534# so uname gets run too.
    535535ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
     
    626626CXXFLAGS
    627627CXX
    628 COMPAT32BITFLAGS
    629628ENABLE_JAVA
    630629VERSION
     
    763762
    764763  case $ac_option in
    765   *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
    766   *=)   ac_optarg= ;;
    767   *)    ac_optarg=yes ;;
     764  *=*)  ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
     765  *)    ac_optarg=yes ;;
    768766  esac
    769767
     
    810808    # Reject names that are not valid shell variable names.
    811809    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
    812       as_fn_error $? "invalid feature name: $ac_useropt"
     810      as_fn_error "invalid feature name: $ac_useropt"
    813811    ac_useropt_orig=$ac_useropt
    814812    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
     
    836834    # Reject names that are not valid shell variable names.
    837835    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
    838       as_fn_error $? "invalid feature name: $ac_useropt"
     836      as_fn_error "invalid feature name: $ac_useropt"
    839837    ac_useropt_orig=$ac_useropt
    840838    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
     
    10401038    # Reject names that are not valid shell variable names.
    10411039    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
    1042       as_fn_error $? "invalid package name: $ac_useropt"
     1040      as_fn_error "invalid package name: $ac_useropt"
    10431041    ac_useropt_orig=$ac_useropt
    10441042    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
     
    10561054    # Reject names that are not valid shell variable names.
    10571055    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
    1058       as_fn_error $? "invalid package name: $ac_useropt"
     1056      as_fn_error "invalid package name: $ac_useropt"
    10591057    ac_useropt_orig=$ac_useropt
    10601058    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
     
    10861084    x_libraries=$ac_optarg ;;
    10871085
    1088   -*) as_fn_error $? "unrecognized option: \`$ac_option'
    1089 Try \`$0 --help' for more information"
     1086  -*) as_fn_error "unrecognized option: \`$ac_option'
     1087Try \`$0 --help' for more information."
    10901088    ;;
    10911089
     
    10951093    case $ac_envvar in #(
    10961094      '' | [0-9]* | *[!_$as_cr_alnum]* )
    1097       as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
     1095      as_fn_error "invalid variable name: \`$ac_envvar'" ;;
    10981096    esac
    10991097    eval $ac_envvar=\$ac_optarg
     
    11131111if test -n "$ac_prev"; then
    11141112  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
    1115   as_fn_error $? "missing argument to $ac_option"
     1113  as_fn_error "missing argument to $ac_option"
    11161114fi
    11171115
     
    11191117  case $enable_option_checking in
    11201118    no) ;;
    1121     fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
     1119    fatal) as_fn_error "unrecognized options: $ac_unrecognized_opts" ;;
    11221120    *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
    11231121  esac
     
    11421140    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
    11431141  esac
    1144   as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
     1142  as_fn_error "expected an absolute directory name for --$ac_var: $ac_val"
    11451143done
    11461144
     
    11561154  if test "x$build_alias" = x; then
    11571155    cross_compiling=maybe
    1158     $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host.
    1159     If a cross compiler is detected then cross compile mode will be used" >&2
     1156    $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
     1157    If a cross compiler is detected then cross compile mode will be used." >&2
    11601158  elif test "x$build_alias" != "x$host_alias"; then
    11611159    cross_compiling=yes
     
    11721170ac_ls_di=`ls -di .` &&
    11731171ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
    1174   as_fn_error $? "working directory cannot be determined"
     1172  as_fn_error "working directory cannot be determined"
    11751173test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
    1176   as_fn_error $? "pwd does not report name of working directory"
     1174  as_fn_error "pwd does not report name of working directory"
    11771175
    11781176
     
    12131211if test ! -r "$srcdir/$ac_unique_file"; then
    12141212  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
    1215   as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
     1213  as_fn_error "cannot find sources ($ac_unique_file) in $srcdir"
    12161214fi
    12171215ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
    12181216ac_abs_confdir=`(
    1219     cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
     1217    cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error "$ac_msg"
    12201218    pwd)`
    12211219# When building in place, set srcdir=.
     
    12571255      --help=recursive    display the short help of all the included packages
    12581256  -V, --version           display version information and exit
    1259   -q, --quiet, --silent   do not print \`checking ...' messages
     1257  -q, --quiet, --silent   do not print \`checking...' messages
    12601258      --cache-file=FILE   cache test results in FILE [disabled]
    12611259  -C, --config-cache      alias for \`--cache-file=config.cache'
     
    14131411  cat <<\_ACEOF
    14141412configure
    1415 generated by GNU Autoconf 2.67
    1416 
    1417 Copyright (C) 2010 Free Software Foundation, Inc.
     1413generated by GNU Autoconf 2.65
     1414
     1415Copyright (C) 2009 Free Software Foundation, Inc.
    14181416This configure script is free software; the Free Software Foundation
    14191417gives unlimited permission to copy, distribute and modify it.
     
    15231521  fi
    15241522  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
    1525   test $ac_status = 0; } > conftest.i && {
     1523  test $ac_status = 0; } >/dev/null && {
    15261524     test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
    15271525     test ! -s conftest.err
     
    15471545{
    15481546  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
    1549   if eval "test \"\${$3+set}\"" = set; then :
     1547  if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
    15501548  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
    15511549$as_echo_n "checking for $2... " >&6; }
    1552 if eval "test \"\${$3+set}\"" = set; then :
     1550if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
    15531551  $as_echo_n "(cached) " >&6
    15541552fi
     
    15861584  ac_header_preproc=no
    15871585fi
    1588 rm -f conftest.err conftest.i conftest.$ac_ext
     1586rm -f conftest.err conftest.$ac_ext
    15891587{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
    15901588$as_echo "$ac_header_preproc" >&6; }
     
    16131611  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
    16141612$as_echo_n "checking for $2... " >&6; }
    1615 if eval "test \"\${$3+set}\"" = set; then :
     1613if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
    16161614  $as_echo_n "(cached) " >&6
    16171615else
     
    16771675  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
    16781676$as_echo_n "checking for $2... " >&6; }
    1679 if eval "test \"\${$3+set}\"" = set; then :
     1677if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
    16801678  $as_echo_n "(cached) " >&6
    16811679else
     
    17541752  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
    17551753$as_echo_n "checking for $2... " >&6; }
    1756 if eval "test \"\${$3+set}\"" = set; then :
     1754if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
    17571755  $as_echo_n "(cached) " >&6
    17581756else
     
    18071805  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
    18081806$as_echo_n "checking for $2... " >&6; }
    1809 if eval "test \"\${$3+set}\"" = set; then :
     1807if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
    18101808  $as_echo_n "(cached) " >&6
    18111809else
     
    18701868
    18711869It was created by $as_me, which was
    1872 generated by GNU Autoconf 2.67.  Invocation command line was
     1870generated by GNU Autoconf 2.65.  Invocation command line was
    18731871
    18741872  $ $0 $@
     
    19801978    echo
    19811979
    1982     $as_echo "## ---------------- ##
     1980    cat <<\_ASBOX
     1981## ---------------- ##
    19831982## Cache variables. ##
    1984 ## ---------------- ##"
     1983## ---------------- ##
     1984_ASBOX
    19851985    echo
    19861986    # The following way of writing the cache mishandles newlines in values,
     
    20162016    echo
    20172017
    2018     $as_echo "## ----------------- ##
     2018    cat <<\_ASBOX
     2019## ----------------- ##
    20192020## Output variables. ##
    2020 ## ----------------- ##"
     2021## ----------------- ##
     2022_ASBOX
    20212023    echo
    20222024    for ac_var in $ac_subst_vars
     
    20312033
    20322034    if test -n "$ac_subst_files"; then
    2033       $as_echo "## ------------------- ##
     2035      cat <<\_ASBOX
     2036## ------------------- ##
    20342037## File substitutions. ##
    2035 ## ------------------- ##"
     2038## ------------------- ##
     2039_ASBOX
    20362040      echo
    20372041      for ac_var in $ac_subst_files
     
    20472051
    20482052    if test -s confdefs.h; then
    2049       $as_echo "## ----------- ##
     2053      cat <<\_ASBOX
     2054## ----------- ##
    20502055## confdefs.h. ##
    2051 ## ----------- ##"
     2056## ----------- ##
     2057_ASBOX
    20522058      echo
    20532059      cat confdefs.h
     
    21042110ac_site_file2=NONE
    21052111if test -n "$CONFIG_SITE"; then
    2106   # We do not want a PATH search for config.site.
    2107   case $CONFIG_SITE in #((
    2108     -*)  ac_site_file1=./$CONFIG_SITE;;
    2109     */*) ac_site_file1=$CONFIG_SITE;;
    2110     *)   ac_site_file1=./$CONFIG_SITE;;
    2111   esac
     2112  ac_site_file1=$CONFIG_SITE
    21122113elif test "x$prefix" != xNONE; then
    21132114  ac_site_file1=$prefix/share/config.site
     
    21242125$as_echo "$as_me: loading site script $ac_site_file" >&6;}
    21252126    sed 's/^/| /' "$ac_site_file" >&5
    2126     . "$ac_site_file" \
    2127       || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
    2128 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
    2129 as_fn_error $? "failed to load site script $ac_site_file
    2130 See \`config.log' for more details" "$LINENO" 5 ; }
     2127    . "$ac_site_file"
    21312128  fi
    21322129done
     
    22042201  { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
    22052202$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
    2206   as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
     2203  as_fn_error "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
    22072204fi
    22082205## -------------------- ##
     
    22222219ac_aux_dir=
    22232220for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
    2224   if test -f "$ac_dir/install-sh"; then
    2225     ac_aux_dir=$ac_dir
    2226     ac_install_sh="$ac_aux_dir/install-sh -c"
    2227     break
    2228   elif test -f "$ac_dir/install.sh"; then
    2229     ac_aux_dir=$ac_dir
    2230     ac_install_sh="$ac_aux_dir/install.sh -c"
    2231     break
    2232   elif test -f "$ac_dir/shtool"; then
    2233     ac_aux_dir=$ac_dir
    2234     ac_install_sh="$ac_aux_dir/shtool install -c"
    2235     break
    2236   fi
     2221  for ac_t in install-sh install.sh shtool; do
     2222    if test -f "$ac_dir/$ac_t"; then
     2223      ac_aux_dir=$ac_dir
     2224      ac_install_sh="$ac_aux_dir/$ac_t -c"
     2225      break 2
     2226    fi
     2227  done
    22372228done
    22382229if test -z "$ac_aux_dir"; then
    2239   as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
     2230  as_fn_error "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
    22402231fi
    22412232
     
    22512242# Make sure we can run config.sub.
    22522243$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
    2253   as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
     2244  as_fn_error "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
    22542245
    22552246{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
     
    22622253  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
    22632254test "x$ac_build_alias" = x &&
    2264   as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
     2255  as_fn_error "cannot guess build type; you must specify one" "$LINENO" 5
    22652256ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
    2266   as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
     2257  as_fn_error "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
    22672258
    22682259fi
     
    22712262case $ac_cv_build in
    22722263*-*-*) ;;
    2273 *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5 ;;
     2264*) as_fn_error "invalid value of canonical build" "$LINENO" 5;;
    22742265esac
    22752266build=$ac_cv_build
     
    22962287else
    22972288  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
    2298     as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
     2289    as_fn_error "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
    22992290fi
    23002291
     
    23042295case $ac_cv_host in
    23052296*-*-*) ;;
    2306 *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5 ;;
     2297*) as_fn_error "invalid value of canonical host" "$LINENO" 5;;
    23072298esac
    23082299host=$ac_cv_host
     
    23292320else
    23302321  ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` ||
    2331     as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5
     2322    as_fn_error "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5
    23322323fi
    23332324
     
    23372328case $ac_cv_target in
    23382329*-*-*) ;;
    2339 *) as_fn_error $? "invalid value of canonical target" "$LINENO" 5 ;;
     2330*) as_fn_error "invalid value of canonical target" "$LINENO" 5;;
    23402331esac
    23412332target=$ac_cv_target
     
    24022393else
    24032394  ENABLE_JAVA=0
    2404 fi
    2405 
    2406 
    2407 { $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if architecture is 64-bit" >&5
    2408 $as_echo_n "checking to see if architecture is 64-bit... " >&6; }
    2409 arch_64bit=no
    2410 case "$host_cpu" in
    2411 x86_64) arch_64bit=yes ;;
    2412 esac
    2413 
    2414 if test "$arch_64bit" = yes; then
    2415   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
    2416 $as_echo "yes" >&6; }
    2417   if test -z "$COMPAT32BITFLAGS" ; then
    2418     COMPAT32BITFLAGS="-m32"
    2419   fi
    2420 else
    2421   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
    2422 $as_echo "no" >&6; }
    2423   if test -z "$COMPAT32BITFLAGS" ; then
    2424     COMPAT32BITFLAGS=
    2425   fi
    24262395fi
    24272396
     
    26512620{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
    26522621$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
    2653 as_fn_error 77 "C++ compiler cannot create executables
    2654 See \`config.log' for more details" "$LINENO" 5 ; }
     2622{ as_fn_set_status 77
     2623as_fn_error "C++ compiler cannot create executables
     2624See \`config.log' for more details." "$LINENO" 5; }; }
    26552625else
    26562626  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
     
    26942664  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
    26952665$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
    2696 as_fn_error $? "cannot compute suffix of executables: cannot compile and link
    2697 See \`config.log' for more details" "$LINENO" 5 ; }
     2666as_fn_error "cannot compute suffix of executables: cannot compile and link
     2667See \`config.log' for more details." "$LINENO" 5; }
    26982668fi
    26992669rm -f conftest conftest$ac_cv_exeext
     
    27522722    { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
    27532723$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
    2754 as_fn_error $? "cannot run C++ compiled programs.
     2724as_fn_error "cannot run C++ compiled programs.
    27552725If you meant to cross compile, use \`--host'.
    2756 See \`config.log' for more details" "$LINENO" 5 ; }
     2726See \`config.log' for more details." "$LINENO" 5; }
    27572727    fi
    27582728  fi
     
    28052775{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
    28062776$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
    2807 as_fn_error $? "cannot compute suffix of object files: cannot compile
    2808 See \`config.log' for more details" "$LINENO" 5 ; }
     2777as_fn_error "cannot compute suffix of object files: cannot compile
     2778See \`config.log' for more details." "$LINENO" 5; }
    28092779fi
    28102780rm -f conftest.$ac_cv_objext conftest.$ac_ext
     
    33203290test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
    33213291$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
    3322 as_fn_error $? "no acceptable C compiler found in \$PATH
    3323 See \`config.log' for more details" "$LINENO" 5 ; }
     3292as_fn_error "no acceptable C compiler found in \$PATH
     3293See \`config.log' for more details." "$LINENO" 5; }
    33243294
    33253295# Provide some information about the compiler.
     
    36683638set x ${MAKE-make}
    36693639ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
    3670 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\"" = set; then :
     3640if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then :
    36713641  $as_echo_n "(cached) " >&6
    36723642else
     
    36763646    @echo '@@@%%%=$(MAKE)=@@@%%%'
    36773647_ACEOF
    3678 # GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
     3648# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
    36793649case `${MAKE-make} -f conftest.make 2>/dev/null` in
    36803650  *@@@%%%=?*=@@@%%%*)
     
    38793849
    38803850    fi
    3881     test x$JAVA = x && as_fn_error $? "no acceptable Java virtual machine found in \$PATH" "$LINENO" 5
     3851    test x$JAVA = x && as_fn_error "no acceptable Java virtual machine found in \$PATH" "$LINENO" 5
    38823852fi
    38833853
     
    39413911        ac_cv_prog_uudecode_base64=yes
    39423912else
    3943         echo "configure: 3943: uudecode had trouble decoding base 64 file 'Test.uue'" >&5
     3913        echo "configure: 3913: uudecode had trouble decoding base 64 file 'Test.uue'" >&5
    39443914        echo "configure: failed file was:" >&5
    39453915        cat Test.uue >&5
     
    39563926$as_echo "$as_me: WARNING: I have to compile Test.class from scratch" >&2;}
    39573927        if test x$ac_cv_prog_javac_works = xno; then
    3958                 as_fn_error $? "Cannot compile java source. $JAVAC does not work properly" "$LINENO" 5
     3928                as_fn_error "Cannot compile java source. $JAVAC does not work properly" "$LINENO" 5
    39593929        fi
    39603930        if test x$ac_cv_prog_javac_works = x; then
     
    40494019
    40504020  fi
    4051   test "x$JAVAC" = x && as_fn_error $? "no acceptable Java compiler found in \$PATH" "$LINENO" 5
     4021  test "x$JAVAC" = x && as_fn_error "no acceptable Java compiler found in \$PATH" "$LINENO" 5
    40524022else
    40534023  echo "Checking for javac... $JAVAC"
     
    40644034CLASS_TEST=Test.class
    40654035cat << \EOF > $JAVA_TEST
    4066 /* #line 4066 "configure" */
     4036/* #line 4036 "configure" */
    40674037public class Test {
    40684038}
     
    40764046  ac_cv_prog_javac_works=yes
    40774047else
    4078   as_fn_error $? "The Java compiler $JAVAC failed (see config.log, check the CLASSPATH?)" "$LINENO" 5
     4048  as_fn_error "The Java compiler $JAVAC failed (see config.log, check the CLASSPATH?)" "$LINENO" 5
    40794049  echo "configure: failed program was:" >&5
    40804050  cat $JAVA_TEST >&5
     
    41034073TEST=Test
    41044074cat << \EOF > $JAVA_TEST
    4105 /* [#]line 4105 "configure" */
     4075/* [#]line 4075 "configure" */
    41064076public class Test {
    41074077public static void main (String args[]) {
     
    41204090          echo "configure: failed program was:" >&5
    41214091          cat $JAVA_TEST >&5
    4122           as_fn_error $? "The Java compiler $JAVAC failed (see config.log, check the CLASSPATH?)" "$LINENO" 5
     4092          as_fn_error "The Java compiler $JAVAC failed (see config.log, check the CLASSPATH?)" "$LINENO" 5
    41234093        fi
    41244094fi
     
    41334103  echo "configure: failed program was:" >&5
    41344104  cat $JAVA_TEST >&5
    4135   as_fn_error $? "The Java VM $JAVA failed (see config.log, check the CLASSPATH?)" "$LINENO" 5
     4105  as_fn_error "The Java VM $JAVA failed (see config.log, check the CLASSPATH?)" "$LINENO" 5
    41364106fi
    41374107rm -fr $JAVA_TEST $CLASS_TEST Test.uue
     
    42334203
    42344204  fi
    4235   test "x$JAVAC" = x && as_fn_error $? "no acceptable Java compiler found in \$PATH" "$LINENO" 5
     4205  test "x$JAVAC" = x && as_fn_error "no acceptable Java compiler found in \$PATH" "$LINENO" 5
    42364206else
    42374207  echo "Checking for javac... $JAVAC"
     
    42484218CLASS_TEST=Test.class
    42494219cat << \EOF > $JAVA_TEST
    4250 /* #line 4250 "configure" */
     4220/* #line 4220 "configure" */
    42514221public class Test {
    42524222}
     
    42604230  ac_cv_prog_javac_works=yes
    42614231else
    4262   as_fn_error $? "The Java compiler $JAVAC failed (see config.log, check the CLASSPATH?)" "$LINENO" 5
     4232  as_fn_error "The Java compiler $JAVAC failed (see config.log, check the CLASSPATH?)" "$LINENO" 5
    42634233  echo "configure: failed program was:" >&5
    42644234  cat $JAVA_TEST >&5
     
    43204290continue
    43214291fi
    4322 rm -f conftest.err conftest.i conftest.$ac_ext
     4292rm -f conftest.err conftest.$ac_ext
    43234293
    43244294  # OK, works on sane cases.  Now check whether nonexistent headers
     
    43364306break
    43374307fi
    4338 rm -f conftest.err conftest.i conftest.$ac_ext
     4308rm -f conftest.err conftest.$ac_ext
    43394309
    43404310done
    43414311# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
    4342 rm -f conftest.i conftest.err conftest.$ac_ext
     4312rm -f conftest.err conftest.$ac_ext
    43434313if $ac_preproc_ok; then :
    43444314  break
     
    43794349continue
    43804350fi
    4381 rm -f conftest.err conftest.i conftest.$ac_ext
     4351rm -f conftest.err conftest.$ac_ext
    43824352
    43834353  # OK, works on sane cases.  Now check whether nonexistent headers
     
    43954365break
    43964366fi
    4397 rm -f conftest.err conftest.i conftest.$ac_ext
     4367rm -f conftest.err conftest.$ac_ext
    43984368
    43994369done
    44004370# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
    4401 rm -f conftest.i conftest.err conftest.$ac_ext
     4371rm -f conftest.err conftest.$ac_ext
    44024372if $ac_preproc_ok; then :
    44034373
     
    44054375  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
    44064376$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
    4407 as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
    4408 See \`config.log' for more details" "$LINENO" 5 ; }
     4377as_fn_error "C preprocessor \"$CPP\" fails sanity check
     4378See \`config.log' for more details." "$LINENO" 5; }
    44094379fi
    44104380
     
    44674437IFS=$as_save_IFS
    44684438  if test -z "$ac_cv_path_GREP"; then
    4469     as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
     4439    as_fn_error "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
    44704440  fi
    44714441else
     
    45334503IFS=$as_save_IFS
    45344504  if test -z "$ac_cv_path_EGREP"; then
    4535     as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
     4505    as_fn_error "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
    45364506  fi
    45374507else
     
    46654635ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
    46664636"
    4667 if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
     4637eval as_val=\$$as_ac_Header
     4638   if test "x$as_val" = x""yes; then :
    46684639  cat >>confdefs.h <<_ACEOF
    46694640#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
     
    50975068{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5
    50985069$as_echo_n "checking for $ac_hdr that defines DIR... " >&6; }
    5099 if eval "test \"\${$as_ac_Header+set}\"" = set; then :
     5070if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then :
    51005071  $as_echo_n "(cached) " >&6
    51015072else
     
    51245095           { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
    51255096$as_echo "$ac_res" >&6; }
    5126 if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
     5097eval as_val=\$$as_ac_Header
     5098   if test "x$as_val" = x""yes; then :
    51275099  cat >>confdefs.h <<_ACEOF
    51285100#define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
     
    53665338  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
    53675339ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
    5368 if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
     5340eval as_val=\$$as_ac_Header
     5341   if test "x$as_val" = x""yes; then :
    53695342  cat >>confdefs.h <<_ACEOF
    53705343#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
     
    55395512    as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
    55405513ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
    5541 if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
     5514eval as_val=\$$as_ac_var
     5515   if test "x$as_val" = x""yes; then :
    55425516
    55435517cat >>confdefs.h <<_ACEOF
     
    56995673  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
    57005674ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
    5701 if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
     5675eval as_val=\$$as_ac_var
     5676   if test "x$as_val" = x""yes; then :
    57025677  cat >>confdefs.h <<_ACEOF
    57035678#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
     
    57075682done
    57085683
    5709 ac_fn_c_check_func "$LINENO" "ftruncate" "ac_cv_func_ftruncate"
    5710 if test "x$ac_cv_func_ftruncate" = x""yes; then :
    5711   $as_echo "#define HAVE_FTRUNCATE 1" >>confdefs.h
     5684for ac_func in ftruncate strstr strcasecmp
     5685do :
     5686  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
     5687ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
     5688eval as_val=\$$as_ac_var
     5689   if test "x$as_val" = x""yes; then :
     5690  cat >>confdefs.h <<_ACEOF
     5691#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
     5692_ACEOF
    57125693
    57135694else
    57145695  case " $LIBOBJS " in
    5715   *" ftruncate.$ac_objext "* ) ;;
    5716   *) LIBOBJS="$LIBOBJS ftruncate.$ac_objext"
     5696  *" $ac_func.$ac_objext "* ) ;;
     5697  *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext"
    57175698 ;;
    57185699esac
    57195700
    57205701fi
    5721 
    5722 ac_fn_c_check_func "$LINENO" "strstr" "ac_cv_func_strstr"
    5723 if test "x$ac_cv_func_strstr" = x""yes; then :
    5724   $as_echo "#define HAVE_STRSTR 1" >>confdefs.h
    5725 
    5726 else
    5727   case " $LIBOBJS " in
    5728   *" strstr.$ac_objext "* ) ;;
    5729   *) LIBOBJS="$LIBOBJS strstr.$ac_objext"
    5730  ;;
    5731 esac
    5732 
    5733 fi
    5734 
    5735 ac_fn_c_check_func "$LINENO" "strcasecmp" "ac_cv_func_strcasecmp"
    5736 if test "x$ac_cv_func_strcasecmp" = x""yes; then :
    5737   $as_echo "#define HAVE_STRCASECMP 1" >>confdefs.h
    5738 
    5739 else
    5740   case " $LIBOBJS " in
    5741   *" strcasecmp.$ac_objext "* ) ;;
    5742   *) LIBOBJS="$LIBOBJS strcasecmp.$ac_objext"
    5743  ;;
    5744 esac
    5745 
    5746 fi
     5702done
    57475703
    57485704
     
    60936049     ;; #(
    60946050   *)
    6095      as_fn_error $? "unknown endianness
    6096  presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5  ;;
     6051     as_fn_error "unknown endianness
     6052 presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
    60976053 esac
    60986054
     
    62046160ac_libobjs=
    62056161ac_ltlibobjs=
    6206 U=
    62076162for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
    62086163  # 1. Remove the extension, and $U if already installed.
     
    63676322
    63686323
    6369 # as_fn_error STATUS ERROR [LINENO LOG_FD]
    6370 # ----------------------------------------
     6324# as_fn_error ERROR [LINENO LOG_FD]
     6325# ---------------------------------
    63716326# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
    63726327# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
    6373 # script with STATUS, using 1 if that was 0.
     6328# script with status $?, using 1 if that was 0.
    63746329as_fn_error ()
    63756330{
    6376   as_status=$1; test $as_status -eq 0 && as_status=1
    6377   if test "$4"; then
    6378     as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
    6379     $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
     6331  as_status=$?; test $as_status -eq 0 && as_status=1
     6332  if test "$3"; then
     6333    as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
     6334    $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3
    63806335  fi
    6381   $as_echo "$as_me: error: $2" >&2
     6336  $as_echo "$as_me: error: $1" >&2
    63826337  as_fn_exit $as_status
    63836338} # as_fn_error
     
    65756530    done
    65766531    test -z "$as_dirs" || eval "mkdir $as_dirs"
    6577   } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
     6532  } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir"
    65786533
    65796534
     
    66296584ac_log="
    66306585This file was extended by $as_me, which was
    6631 generated by GNU Autoconf 2.67.  Invocation command line was
     6586generated by GNU Autoconf 2.65.  Invocation command line was
    66326587
    66336588  CONFIG_FILES    = $CONFIG_FILES
     
    66956650ac_cs_version="\\
    66966651config.status
    6697 configured by $0, generated by GNU Autoconf 2.67,
     6652configured by $0, generated by GNU Autoconf 2.65,
    66986653  with options \\"\$ac_cs_config\\"
    66996654
    6700 Copyright (C) 2010 Free Software Foundation, Inc.
     6655Copyright (C) 2009 Free Software Foundation, Inc.
    67016656This config.status script is free software; the Free Software Foundation
    67026657gives unlimited permission to copy, distribute and modify it."
     
    67156670do
    67166671  case $1 in
    6717   --*=?*)
     6672  --*=*)
    67186673    ac_option=`expr "X$1" : 'X\([^=]*\)='`
    67196674    ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
    6720     ac_shift=:
    6721     ;;
    6722   --*=)
    6723     ac_option=`expr "X$1" : 'X\([^=]*\)='`
    6724     ac_optarg=
    67256675    ac_shift=:
    67266676    ;;
     
    67466696    case $ac_optarg in
    67476697    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
    6748     '') as_fn_error $? "missing file argument" ;;
    67496698    esac
    67506699    as_fn_append CONFIG_FILES " '$ac_optarg'"
     
    67596708  --he | --h)
    67606709    # Conflict between --help and --header
    6761     as_fn_error $? "ambiguous option: \`$1'
     6710    as_fn_error "ambiguous option: \`$1'
    67626711Try \`$0 --help' for more information.";;
    67636712  --help | --hel | -h )
     
    67686717
    67696718  # This is an error.
    6770   -*) as_fn_error $? "unrecognized option: \`$1'
     6719  -*) as_fn_error "unrecognized option: \`$1'
    67716720Try \`$0 --help' for more information." ;;
    67726721
     
    68256774    "default") CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
    68266775
    6827   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5 ;;
     6776  *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
    68286777  esac
    68296778done
     
    68636812  tmp=./conf$$-$RANDOM
    68646813  (umask 077 && mkdir "$tmp")
    6865 } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
     6814} || as_fn_error "cannot create a temporary directory in ." "$LINENO" 5
    68666815
    68676816# Set up the scripts for CONFIG_FILES section.
     
    68806829ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
    68816830if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
    6882   ac_cs_awk_cr='\\r'
     6831  ac_cs_awk_cr='\r'
    68836832else
    68846833  ac_cs_awk_cr=$ac_cr
     
    68946843  echo "_ACEOF"
    68956844} >conf$$subs.sh ||
    6896   as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
    6897 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
     6845  as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
     6846ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'`
    68986847ac_delim='%!_!# '
    68996848for ac_last_try in false false false false false :; do
    69006849  . ./conf$$subs.sh ||
    6901     as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
     6850    as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
    69026851
    69036852  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
     
    69056854    break
    69066855  elif $ac_last_try; then
    6907     as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
     6856    as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
    69086857  else
    69096858    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
     
    69946943  cat
    69956944fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
    6996   || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
    6997 _ACEOF
    6998 
    6999 # VPATH may cause trouble with some makes, so we remove sole $(srcdir),
    7000 # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
     6945  || as_fn_error "could not setup config files machinery" "$LINENO" 5
     6946_ACEOF
     6947
     6948# VPATH may cause trouble with some makes, so we remove $(srcdir),
     6949# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
    70016950# trailing colons and then remove the whole line if VPATH becomes empty
    70026951# (actually we leave an empty line to preserve line numbers).
    70036952if test "x$srcdir" = x.; then
    7004   ac_vpsub='/^[  ]*VPATH[    ]*=[    ]*/{
    7005 h
    7006 s///
    7007 s/^/:/
    7008 s/[  ]*$/:/
    7009 s/:\$(srcdir):/:/g
    7010 s/:\${srcdir}:/:/g
    7011 s/:@srcdir@:/:/g
    7012 s/^:*//
     6953  ac_vpsub='/^[  ]*VPATH[    ]*=/{
     6954s/:*\$(srcdir):*/:/
     6955s/:*\${srcdir}:*/:/
     6956s/:*@srcdir@:*/:/
     6957s/^\([^=]*=[     ]*\):*/\1/
    70136958s/:*$//
    7014 x
    7015 s/\(=[   ]*\).*/\1/
    7016 G
    7017 s/\n//
    70186959s/^[^=]*=[   ]*$//
    70196960}'
     
    70436984    break
    70446985  elif $ac_last_try; then
    7045     as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
     6986    as_fn_error "could not make $CONFIG_HEADERS" "$LINENO" 5
    70466987  else
    70476988    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
     
    71287069_ACEOF
    71297070cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
    7130   as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
     7071  as_fn_error "could not setup config headers machinery" "$LINENO" 5
    71317072fi # test -n "$CONFIG_HEADERS"
    71327073
     
    71417082  case $ac_mode$ac_tag in
    71427083  :[FHL]*:*);;
    7143   :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5 ;;
     7084  :L* | :C*:*) as_fn_error "invalid tag \`$ac_tag'" "$LINENO" 5;;
    71447085  :[FH]-) ac_tag=-:-;;
    71457086  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
     
    71697110       *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
    71707111       esac ||
    7171        as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5 ;;
     7112       as_fn_error "cannot find input file: \`$ac_f'" "$LINENO" 5;;
    71727113      esac
    71737114      case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
     
    71967137    case $ac_tag in
    71977138    *:-:* | *:-) cat >"$tmp/stdin" \
    7198       || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
     7139      || as_fn_error "could not create $ac_file" "$LINENO" 5 ;;
    71997140    esac
    72007141    ;;
     
    73277268"
    73287269eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
    7329   || as_fn_error $? "could not create $ac_file" "$LINENO" 5
     7270  || as_fn_error "could not create $ac_file" "$LINENO" 5
    73307271
    73317272test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
     
    73337274  { ac_out=`sed -n '/^[  ]*datarootdir[  ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
    73347275  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
    7335 which seems to be undefined.  Please make sure it is defined" >&5
     7276which seems to be undefined.  Please make sure it is defined." >&5
    73367277$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
    7337 which seems to be undefined.  Please make sure it is defined" >&2;}
     7278which seems to be undefined.  Please make sure it is defined." >&2;}
    73387279
    73397280  rm -f "$tmp/stdin"
     
    73427283  *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
    73437284  esac \
    7344   || as_fn_error $? "could not create $ac_file" "$LINENO" 5
     7285  || as_fn_error "could not create $ac_file" "$LINENO" 5
    73457286 ;;
    73467287  :H)
     
    73537294      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs"
    73547295    } >"$tmp/config.h" \
    7355       || as_fn_error $? "could not create $ac_file" "$LINENO" 5
     7296      || as_fn_error "could not create $ac_file" "$LINENO" 5
    73567297    if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then
    73577298      { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
     
    73607301      rm -f "$ac_file"
    73617302      mv "$tmp/config.h" "$ac_file" \
    7362     || as_fn_error $? "could not create $ac_file" "$LINENO" 5
     7303    || as_fn_error "could not create $ac_file" "$LINENO" 5
    73637304    fi
    73647305  else
    73657306    $as_echo "/* $configure_input  */" \
    73667307      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \
    7367       || as_fn_error $? "could not create -" "$LINENO" 5
     7308      || as_fn_error "could not create -" "$LINENO" 5
    73687309  fi
    73697310 ;;
     
    73877328
    73887329test $ac_write_fail = 0 ||
    7389   as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
     7330  as_fn_error "write failure creating $CONFIG_STATUS" "$LINENO" 5
    73907331
    73917332
     
    74087349  # Use ||, not &&, to avoid exiting from the if with $? = 1, which
    74097350  # would make configure fail if this is the last instruction.
    7410   $ac_cs_success || as_fn_exit 1
     7351  $ac_cs_success || as_fn_exit $?
    74117352fi
    74127353if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
  • main/trunk/greenstone2/common-src/indexers/mg/configure.in

    r23356 r25147  
    3434AC_SUBST(ENABLE_JAVA)
    3535
    36 AC_MSG_CHECKING(to see if architecture is 64-bit)
    37 arch_64bit=no
    38 case "$host_cpu" in
    39 x86_64) arch_64bit=yes ;;
    40 esac
    41 
    42 if test "$arch_64bit" = yes; then
    43   AC_MSG_RESULT(yes)
    44   if test -z "$COMPAT32BITFLAGS" ; then
    45     COMPAT32BITFLAGS="-m32"
    46   fi
    47 else
    48   AC_MSG_RESULT(no)
    49   if test -z "$COMPAT32BITFLAGS" ; then
    50     COMPAT32BITFLAGS=
    51   fi
    52 fi
    53 AC_SUBST(COMPAT32BITFLAGS)
    54 
     36dnl AC_MSG_CHECKING(to see if architecture is 64-bit)
     37dnl arch_64bit=no
     38dnl case "$host_cpu" in
     39dnl x86_64) arch_64bit=yes ;;
     40dnl esac
    5541
    5642dnl Checks for programs.
  • main/trunk/greenstone2/common-src/indexers/mg/java/org/greenstone/mg/Makefile.in

    r23356 r25147  
    1717JAVAH = javah
    1818JAR = jar
    19 CFLAGS = @CFLAGS@ @COMPAT32BITFLAGS@ -ansi -DSILENT -DSHORT_SUFFIX
    20 CXXFLAGS = @CXXFLAGS@ @COMPAT32BITFLAGS@ -DSILENT -DSHORT_SUFFIX
     19CFLAGS = @CFLAGS@ -ansi -DSILENT -DSHORT_SUFFIX
     20CXXFLAGS = @CXXFLAGS@ -DSILENT -DSHORT_SUFFIX
    2121JAVACFLAGS = @JAVACFLAGS@
    2222DEFS = @DEFS@
     
    2525INSTALL_DATA = @INSTALL_DATA@
    2626INSTALL_PROGRAM = @INSTALL_PROGRAM@
    27 LDFLAGS = @LDFLAGS@ @COMPAT32BITFLAGS@
     27LDFLAGS = @LDFLAGS@
    2828LIBS =  -lstdc++ @LIBS@
    2929TOUCH = echo timestamp >
  • main/trunk/greenstone2/common-src/indexers/mg/jni/MGRetrieveWrapperImpl.c

    r16583 r25147  
    180180
    181181  /* Save the object on the Java side */
    182   (*j_env)->SetIntField(j_env, j_obj, FID_mg_data, (long) data);
     182  (*j_env)->SetIntField(j_env, j_obj, FID_mg_data, (mg_s_long) data);
    183183
    184184  /* Initialise MG environment variables */
     
    250250  query_data* qd;
    251251
    252   u_long pos, len;
     252  mg_u_long pos, len;
    253253  u_char* c_buffer = NULL;
    254254  u_char* uc_buffer = NULL;
     
    287287
    288288  /* Get the document position and length in the text file */
    289   printf("Fetching document number %ld...\n", (unsigned long) j_docnum);
    290   FetchDocStart(qd, (unsigned long) j_docnum, &pos, &len);
    291   printf("Fetched document start. Pos: %ld, Len: %ld\n", pos, len);
     289  printf("Fetching document number %d...\n", (mg_u_long) j_docnum);
     290  FetchDocStart(qd, (mg_u_long) j_docnum, &pos, &len);
     291  printf("Fetched document start. Pos: %d, Len: %d\n", pos, len);
    292292
    293293  /* Allocate memory for the document text (from mg/src/text/mgquery.c:RawDocOutput()) */
  • main/trunk/greenstone2/common-src/indexers/mg/jni/MGSearchWrapperImpl.c

    r16583 r25147  
    619619
    620620  /* Print the data to a character array */
    621   sprintf(result, "Query params:\nindex\t\t%s\ncasefold\t%d\nstem\t\t%d\nquery type\t%s\nmax docs\t%ld\n",
     621  sprintf(result, "Query params:\nindex\t\t%s\ncasefold\t%d\nstem\t\t%d\nquery type\t%s\nmax docs\t%d\n",
    622622      (data->queryInfo->index == NULL ? "<none loaded>" : data->queryInfo->index),
    623623      (data->defaultStemMethod & 1),
  • main/trunk/greenstone2/common-src/indexers/mg/jni/MGWrapperImpl.c

    r16583 r25147  
    168168
    169169  /* Save the object on the Java side */
    170   (*j_env)->SetIntField(j_env, j_obj, FID_mg_data, (long) data);
     170  (*j_env)->SetIntField(j_env, j_obj, FID_mg_data, (mg_s_long) data);
    171171
    172172  /* Initialise MG environment variables */
     
    285285  query_data* qd;
    286286
    287   u_long pos, len;
     287  mg_u_long pos, len;
    288288  u_char* c_buffer = NULL;
    289289  u_char* uc_buffer = NULL;
     
    322322
    323323  /* Get the document position and length in the text file */
    324   printf("Fetching document number %ld...\n", (unsigned long) j_docnum);
    325   FetchDocStart(qd, (unsigned long) j_docnum, &pos, &len);
    326   printf("Fetched document start. Pos: %ld, Len: %ld\n", pos, len);
     324  printf("Fetching document number %d...\n", (mg_u_long) j_docnum);
     325  FetchDocStart(qd, (mg_u_long) j_docnum, &pos, &len);
     326  printf("Fetched document start. Pos: %d, Len: %d\n", pos, len);
    327327
    328328  /* Allocate memory for the document text (from mg/src/text/mgquery.c:RawDocOutput()) */
     
    730730
    731731  /* Print the data to a character array */
    732   sprintf(result, "Query params:\nindex\t\t%s\ncasefold\t%d\nstem\t\t%d\nquery type\t%s\nmax docs\t%ld\n",
     732  sprintf(result, "Query params:\nindex\t\t%s\ncasefold\t%d\nstem\t\t%d\nquery type\t%s\nmax docs\t%d\n",
    733733      (data->queryInfo->index == NULL ? "<none loaded>" : data->queryInfo->index),
    734734      (data->defaultStemMethod & 1),
  • main/trunk/greenstone2/common-src/indexers/mg/jni/MGWrapperImpl.h

    r16583 r25147  
    3636  char* index;
    3737  /* Maximum number of documents to retrieve */
    38   unsigned long maxDocs;
     38  mg_u_long maxDocs;
    3939  /* Whether term frequency information is desired (boolean value) */
    4040  int needTermFreqs;
  • main/trunk/greenstone2/common-src/indexers/mg/jni/Makefile.in

    r22070 r25147  
    1414AR = ar
    1515CC = @CC@
    16 CFLAGS = @CFLAGS@ @COMPAT32BITFLAGS@ -ansi -fpic -DSILENT -DSHORT_SUFFIX -DNZDL -DQUIET -DPARADOCNUM
     16CFLAGS = @CFLAGS@ -ansi -fpic -DSILENT -DSHORT_SUFFIX -DNZDL -DQUIET -DPARADOCNUM
    1717DEFS = @DEFS@
    1818RANLIB = @RANLIB@
     
    2020INSTALL_DATA = @INSTALL_DATA@
    2121INSTALL_PROGRAM = @INSTALL_PROGRAM@
    22 LDFLAGS = @LDFLAGS@ @COMPAT32BITFLAGS@
     22LDFLAGS = @LDFLAGS@
    2323#NOTE: libmgtext.a needs to come before libmglib.a !!!
    2424QUERY_LIBS = ../src/text/libmgtext.a ../lib/libmglib.a @LIBS@
  • main/trunk/greenstone2/common-src/indexers/mg/lib/Makefile.in

    r22070 r25147  
    3434AR = ar
    3535CC = @CC@
    36 CFLAGS = @CFLAGS@ @COMPAT32BITFLAGS@ -fpic
     36CFLAGS = @CFLAGS@ -fpic
    3737DEFS = @DEFS@
    3838RANLIB = @RANLIB@
     
    4141# Uncomment for compiling for the nzdl project
    4242#
    43 CFLAGS = @CFLAGS@ @COMPAT32BITFLAGS@ -DQUIET -fpic
     43CFLAGS = @CFLAGS@ -DQUIET -fpic
    4444##########################################
    4545
  • main/trunk/greenstone2/common-src/indexers/mg/lib/bitio_gen.c

    r16583 r25147  
    2828int fprintf (FILE *, const char *,...);
    2929
    30 unsigned long
    31 BIO_Unary_Length (unsigned long val)
     30mg_u_long
     31BIO_Unary_Length (mg_u_long val)
    3232{
    33   register unsigned long num;
     33  register mg_u_long num;
    3434  UNARY_LENGTH (val, num);
    3535  return (num);
     
    3737
    3838
    39 unsigned long
    40 BIO_Binary_Length (unsigned long val, unsigned long b)
     39mg_u_long
     40BIO_Binary_Length (mg_u_long val, mg_u_long b)
    4141{
    42   register unsigned long num;
     42  register mg_u_long num;
    4343  BINARY_LENGTH (val, b, num);
    4444  return (num);
     
    4646
    4747
    48 unsigned long
    49 BIO_Gamma_Length (unsigned long val)
     48mg_u_long
     49BIO_Gamma_Length (mg_u_long val)
    5050{
    51   register unsigned long num;
     51  register mg_u_long num;
    5252  GAMMA_LENGTH (val, num);
    5353  return (num);
     
    5555
    5656
    57 unsigned long
    58 BIO_Delta_Length (unsigned long val)
     57mg_u_long
     58BIO_Delta_Length (mg_u_long val)
    5959{
    60   register unsigned long num;
     60  register mg_u_long num;
    6161  DELTA_LENGTH (val, num);
    6262  return (num);
     
    6464
    6565
    66 unsigned long
    67 BIO_Elias_Length (unsigned long val, unsigned long b, double s)
     66mg_u_long
     67BIO_Elias_Length (mg_u_long val, mg_u_long b, double s)
    6868{
    69   register unsigned long num;
     69  register mg_u_long num;
    7070  ELIAS_LENGTH (val, b, s, num);
    7171  return (num);
    7272}
    7373
    74 unsigned long
    75 BIO_Bblock_Length (unsigned long val, unsigned long b)
     74mg_u_long
     75BIO_Bblock_Length (mg_u_long val, mg_u_long b)
    7676{
    77   register unsigned long num;
     77  register mg_u_long num;
    7878  BBLOCK_LENGTH (val, b, num);
    7979  return (num);
  • main/trunk/greenstone2/common-src/indexers/mg/lib/bitio_gen.h

    r16583 r25147  
    3333#define H_BITIO_GEN
    3434
    35 unsigned long BIO_Unary_Length (unsigned long val);
     35mg_u_long BIO_Unary_Length (mg_u_long val);
    3636
    37 unsigned long BIO_Binary_Length (unsigned long val, unsigned long b);
     37mg_u_long BIO_Binary_Length (mg_u_long val, mg_u_long b);
    3838
    39 unsigned long BIO_Gamma_Length (unsigned long val);
     39mg_u_long BIO_Gamma_Length (mg_u_long val);
    4040
    41 unsigned long BIO_Delta_Length (unsigned long val);
     41mg_u_long BIO_Delta_Length (mg_u_long val);
    4242
    43 unsigned long BIO_Elias_Length (unsigned long val, unsigned long b, double s);
     43mg_u_long BIO_Elias_Length (mg_u_long val, mg_u_long b, double s);
    4444
    45 unsigned long BIO_Bblock_Length (unsigned long val, unsigned long b);
     45mg_u_long BIO_Bblock_Length (mg_u_long val, mg_u_long b);
    4646
    4747int BIO_Bblock_Init (int N, int p);
  • main/trunk/greenstone2/common-src/indexers/mg/lib/bitio_m.h

    r16583 r25147  
    5050#define POSITIVE(f, x)                          \
    5151  if ((x)<=0)                               \
    52     fprintf(stderr,"Error: Cannot "#f" encode %lu\n",(unsigned long)x),exit(1);
     52    fprintf(stderr,"Error: Cannot "#f" encode %d\n",(mg_u_long)x),exit(1);
    5353
    5454
     
    7575#define UNARY_ENCODE(x)                         \
    7676do {                                    \
    77   register unsigned long _B_x = (x);                    \
     77  register mg_u_long _B_x = (x);                    \
    7878  BIO_ENCODE_PROLOGUE;                          \
    7979  POSITIVE(unary, _B_x);                        \
     
    8585#define UNARY_ENCODE_L(x, count)                    \
    8686do {                                    \
    87   register unsigned long _B_x = (x);                    \
     87  register mg_u_long _B_x = (x);                    \
    8888  BIO_ENCODE_PROLOGUE;                          \
    8989  POSITIVE(unary, _B_x);                        \
     
    124124#define BINARY_ENCODE(x, b)                     \
    125125do {                                    \
    126   register unsigned long _B_x = (x);                    \
    127   register unsigned long _B_b = (b);                    \
     126  register mg_u_long _B_x = (x);                    \
     127  register mg_u_long _B_b = (b);                    \
    128128  register int _B_nbits, _B_logofb, _B_thresh;              \
    129129  BIO_ENCODE_PROLOGUE;                          \
     
    145145#define BINARY_ENCODE_L(x, b, count)                    \
    146146do {                                    \
    147   register unsigned long _B_x = (x);                    \
    148   register unsigned long _B_b = (b);                    \
     147  register mg_u_long _B_x = (x);                    \
     148  register mg_u_long _B_b = (b);                    \
    149149  register int _B_nbits, _B_logofb, _B_thresh;              \
    150150  BIO_ENCODE_PROLOGUE;                          \
     
    168168#define BINARY_DECODE(x, b)                     \
    169169do {                                    \
    170   register unsigned long _B_x = 0;                  \
    171   register unsigned long _B_b = (b);                    \
     170  register mg_u_long _B_x = 0;                  \
     171  register mg_u_long _B_b = (b);                    \
    172172  register int _B_i, _B_logofb, _B_thresh;              \
    173173  BIO_DECODE_PROLOGUE;                          \
     
    193193#define BINARY_DECODE_L(x, b, count)                    \
    194194do {                                    \
    195   register unsigned long _B_x = 0;                  \
    196   register unsigned long _B_b = (b);                    \
     195  register mg_u_long _B_x = 0;                  \
     196  register mg_u_long _B_b = (b);                    \
    197197  register int _B_i, _B_logofb, _B_thresh;              \
    198198  BIO_DECODE_PROLOGUE;                          \
     
    220220#define BINARY_LENGTH(x, b, count)                  \
    221221do {                                    \
    222   register unsigned long _B_x = (x);                    \
    223   register unsigned long _B_b = (b);                    \
     222  register mg_u_long _B_x = (x);                    \
     223  register mg_u_long _B_b = (b);                    \
    224224  register int _B_nbits, _B_logofb, _B_thresh;              \
    225225  POSITIVE(binary, _B_x);                       \
     
    240240#define GAMMA_ENCODE(x)                         \
    241241do {                                    \
    242   register unsigned long _B_xx = (x);                   \
     242  register mg_u_long _B_xx = (x);                   \
    243243  register int _B_logofb;                       \
    244244  register int _B_nbits;                        \
     
    255255#define GAMMA_ENCODE_L(x, count)                    \
    256256do {                                    \
    257   register unsigned long _B_xx = (x);                   \
     257  register mg_u_long _B_xx = (x);                   \
    258258  register int _B_logofb;                       \
    259259  register int _B_nbits;                        \
     
    271271#define GAMMA_DECODE(x)                         \
    272272do {                                    \
    273   register unsigned long _B_xx = 1;                 \
     273  register mg_u_long _B_xx = 1;                 \
    274274  register int _B_nbits = 0;                        \
    275275  BIO_DECODE_PROLOGUE;                          \
     
    283283#define GAMMA_DECODE_L(x, count)                    \
    284284do {                                    \
    285   register unsigned long _B_xx = 1;                 \
     285  register mg_u_long _B_xx = 1;                 \
    286286  register int _B_nbits = 0;                        \
    287287  BIO_DECODE_PROLOGUE;                          \
     
    296296#define GAMMA_LENGTH(x, count)                      \
    297297do {                                    \
    298   register unsigned long _B_xx = (x);                   \
     298  register mg_u_long _B_xx = (x);                   \
    299299  register int _B_logofb;                       \
    300300  POSITIVE(gamma, _B_xx);                       \
     
    310310#define DELTA_ENCODE(x)                         \
    311311do {                                    \
    312   register unsigned long _B_xxx = (x);                  \
     312  register mg_u_long _B_xxx = (x);                  \
    313313  register int _B_logx;                         \
    314314  FLOORLOG_2(_B_xxx, _B_logx);                      \
     
    319319#define DELTA_ENCODE_L(x, count)                    \
    320320do {                                    \
    321   register unsigned long _B_xxx = (x);                  \
     321  register mg_u_long _B_xxx = (x);                  \
    322322  register int _B_logx;                         \
    323323  FLOORLOG_2(_B_xxx, _B_logx);                      \
     
    329329#define DELTA_DECODE(x)                         \
    330330do {                                    \
    331   register unsigned long _B_xxx;                    \
     331  register mg_u_long _B_xxx;                    \
    332332  register int _B_logx;                         \
    333333  GAMMA_DECODE(_B_logx); --_B_logx;                 \
     
    338338#define DELTA_DECODE_L(x, count)                    \
    339339do {                                    \
    340   register unsigned long _B_xxx;                    \
     340  register mg_u_long _B_xxx;                    \
    341341  register int _B_logx;                         \
    342342  GAMMA_DECODE_L(_B_logx, count); --_B_logx;                \
     
    347347#define DELTA_LENGTH(x, count)                      \
    348348do {                                    \
    349   register unsigned long _B_xxx = (x);                  \
     349  register mg_u_long _B_xxx = (x);                  \
    350350  register int _B_logx, _B_dcount;                  \
    351351  FLOORLOG_2(_B_xxx, _B_logx);                      \
     
    363363#define ELIAS_ENCODE(x, b, s)                       \
    364364do {                                    \
    365   register unsigned long _B_xx = (x);                   \
    366   register unsigned long _B_b = (b);                    \
     365  register mg_u_long _B_xx = (x);                   \
     366  register mg_u_long _B_b = (b);                    \
    367367  register double _B_s = (s);                       \
    368368  register int _B_lower=1, _B_upper=1;                  \
     
    383383#define ELIAS_ENCODE_L(x, b, s, count)                  \
    384384do {                                    \
    385   register unsigned long _B_xx = (x);                   \
    386   register unsigned long _B_b = (b);                    \
     385  register mg_u_long _B_xx = (x);                   \
     386  register mg_u_long _B_b = (b);                    \
    387387  register double _B_s = (s);                       \
    388388  register int _B_lower=1, _B_upper=1;                  \
     
    403403#define ELIAS_DECODE(x, b, s)                       \
    404404do {                                    \
    405   register unsigned long _B_xx;                     \
    406   register unsigned long _B_b = (b);                    \
     405  register mg_u_long _B_xx;                     \
     406  register mg_u_long _B_b = (b);                    \
    407407  register double _B_s = (s);                       \
    408408  register int _B_lower=1, _B_upper=1;                  \
     
    423423#define ELIAS_DECODE_L(x, b, s, count)                  \
    424424do {                                    \
    425   register unsigned long _B_xx;                     \
    426   register unsigned long _B_b = (b);                    \
     425  register mg_u_long _B_xx;                     \
     426  register mg_u_long _B_b = (b);                    \
    427427  register double _B_s = (s);                       \
    428428  register int _B_lower=1, _B_upper=1;                  \
     
    443443#define ELIAS_LENGTH(x, b, s, count)                    \
    444444do {                                    \
    445   register unsigned long _B_xx = (x);                   \
    446   register unsigned long _B_b = (b);                    \
     445  register mg_u_long _B_xx = (x);                   \
     446  register mg_u_long _B_b = (b);                    \
    447447  register double _B_s = (s);                       \
    448448  register int _B_lower=1, _B_upper=1;                  \
     
    468468#define BBLOCK_ENCODE(x, b)                     \
    469469do {                                    \
    470   register unsigned long _B_xx = (x);                   \
    471   register unsigned long _B_bb = (b);                   \
     470  register mg_u_long _B_xx = (x);                   \
     471  register mg_u_long _B_bb = (b);                   \
    472472  register int _B_xdivb = 0;                        \
    473473  POSITIVE(bblock, _B_xx);                      \
     
    484484#define BBLOCK_ENCODE_L(x, b, count)                    \
    485485do {                                    \
    486   register unsigned long _B_xx = (x);                   \
    487   register unsigned long _B_bb = (b);                   \
     486  register mg_u_long _B_xx = (x);                   \
     487  register mg_u_long _B_bb = (b);                   \
    488488  register int _B_xdivb = 0;                        \
    489489  POSITIVE(bblock, _B_xx);                      \
     
    500500#define BBLOCK_DECODE(x, b)                     \
    501501do {                                    \
    502   register unsigned long _B_x1, _B_xx = 0;              \
    503   register unsigned long _B_bb = (b);                   \
     502  register mg_u_long _B_x1, _B_xx = 0;              \
     503  register mg_u_long _B_bb = (b);                   \
    504504  register int _B_xdivb;                        \
    505505  UNARY_DECODE(_B_xdivb); --_B_xdivb;                   \
     
    512512#define BBLOCK_DECODE_L(x, b, count)                    \
    513513do {                                    \
    514   register unsigned long _B_x1, _B_xx = 0;              \
    515   register unsigned long _B_bb = (b);                   \
     514  register mg_u_long _B_x1, _B_xx = 0;              \
     515  register mg_u_long _B_bb = (b);                   \
    516516  register int _B_xdivb;                        \
    517517  UNARY_DECODE_L(_B_xdivb, count); --_B_xdivb;              \
     
    524524#define BBLOCK_LENGTH(x, b, count)                  \
    525525do {                                    \
    526   register unsigned long _B_bcount, _B_xx = (x);            \
    527   register unsigned long _B_bb = (b);                   \
     526  register mg_u_long _B_bcount, _B_xx = (x);            \
     527  register mg_u_long _B_bb = (b);                   \
    528528  register int _B_xdivb = 0;                        \
    529529  POSITIVE(bblock, _B_xx);                      \
  • main/trunk/greenstone2/common-src/indexers/mg/lib/bitio_m_mems.h

    r16583 r25147  
    3636  {
    3737    unsigned char *Base;
    38     unsigned long pos;
     38    mg_u_long pos;
    3939  }
    4040mems_bitio_state;
     
    4444  {                                 \
    4545    register unsigned char *__base = b;                 \
    46     register unsigned long __pos = p;
     46    register mg_u_long __pos = p;
    4747
    4848#define ENCODE_CONTINUE(b)                      \
    4949  {                                 \
    5050    register unsigned char *__base = (b).Base;              \
    51     register unsigned long __pos = (b).pos;
     51    register mg_u_long __pos = (b).pos;
    5252
    5353#define ENCODE_BIT(b)                           \
     
    7676  {                                 \
    7777    register unsigned char *__base = b;                 \
    78     register unsigned long __pos = p;
     78    register mg_u_long __pos = p;
    7979
    8080#define DECODE_CONTINUE(b)                      \
    8181  {                                 \
    8282    register unsigned char *__base = (b).Base;              \
    83     register unsigned long __pos = (b).pos;
     83    register mg_u_long __pos = (b).pos;
    8484
    8585#define DECODE_ADD_FF(b)                        \
  • main/trunk/greenstone2/common-src/indexers/mg/lib/bitio_m_random.h

    r16583 r25147  
    3838    FILE *File;
    3939    unsigned char *Buf;
    40     unsigned long Base;
    41     unsigned long Used;
    42     unsigned long pos;
    43     unsigned long len;
    44     unsigned long sft;
     40    mg_u_long Base;
     41    mg_u_long Used;
     42    mg_u_long pos;
     43    mg_u_long len;
     44    mg_u_long sft;
    4545  }
    4646random_bitio_state;
     
    5151    register FILE *__file = f;                      \
    5252    register unsigned char *__buf;                  \
    53     register unsigned long __pos = 0;                   \
    54     register unsigned long __base = 0;                  \
    55     register unsigned long __is_used = 0;                   \
    56     register unsigned long __len = (l)-1;               \
    57     register unsigned long __sft = 0;                   \
     53    register mg_u_long __pos = 0;                   \
     54    register mg_u_long __base = 0;                  \
     55    register mg_u_long __is_used = 0;                   \
     56    register mg_u_long __len = (l)-1;               \
     57    register mg_u_long __sft = 0;                   \
    5858    while (__len) { ++__sft; __len >>=1; }              \
    5959    __len = 1<<__sft;                           \
     
    6666    register FILE *__file = (b).File;                   \
    6767    register unsigned char *__buf = (b).Buf;                \
    68     register unsigned long __pos = (b).pos;             \
    69     register unsigned long __base = (b).Base;               \
    70     register unsigned long __is_used = (b).Used;                \
    71     register unsigned long __len = (b).len;             \
    72     register unsigned long __sft = (b).sft;
     68    register mg_u_long __pos = (b).pos;             \
     69    register mg_u_long __base = (b).Base;               \
     70    register mg_u_long __is_used = (b).Used;                \
     71    register mg_u_long __len = (b).len;             \
     72    register mg_u_long __sft = (b).sft;
    7373
    7474#define SEEK fprintf(stderr, "Seek to %d\n",__base)
  • main/trunk/greenstone2/common-src/indexers/mg/lib/bitio_mem.c

    r16583 r25147  
    5555
    5656void
    57 BIO_Mem_Unary_Encode (unsigned long val, mem_bitio_state * bs,
    58               unsigned long *bits)
     57BIO_Mem_Unary_Encode (mg_u_long val, mem_bitio_state * bs,
     58              mg_u_long *bits)
    5959{
    6060  ENCODE_CONTINUE (*bs)
     
    6767
    6868
    69 unsigned long
     69mg_u_long
    7070BIO_Mem_Unary_Decode (mem_bitio_state * bs,
    71               unsigned long *bits)
    72 {
    73   register unsigned long val;
     71              mg_u_long *bits)
     72{
     73  register mg_u_long val;
    7474  DECODE_CONTINUE (*bs)
    7575    if (bits)
     
    8888
    8989void
    90 BIO_Mem_Binary_Encode (unsigned long val, unsigned long b,
    91                mem_bitio_state * bs, unsigned long *bits)
     90BIO_Mem_Binary_Encode (mg_u_long val, mg_u_long b,
     91               mem_bitio_state * bs, mg_u_long *bits)
    9292{
    9393  ENCODE_CONTINUE (*bs)
     
    100100
    101101
    102 unsigned long
    103 BIO_Mem_Binary_Decode (unsigned long b, mem_bitio_state * bs,
    104                unsigned long *bits)
    105 {
    106   register unsigned long val;
     102mg_u_long
     103BIO_Mem_Binary_Decode (mg_u_long b, mem_bitio_state * bs,
     104               mg_u_long *bits)
     105{
     106  register mg_u_long val;
    107107  DECODE_CONTINUE (*bs)
    108108    if (bits)
     
    121121
    122122void
    123 BIO_Mem_Gamma_Encode (unsigned long val, mem_bitio_state * bs,
    124               unsigned long *bits)
     123BIO_Mem_Gamma_Encode (mg_u_long val, mem_bitio_state * bs,
     124              mg_u_long *bits)
    125125{
    126126  ENCODE_CONTINUE (*bs)
     
    133133
    134134
    135 unsigned long
    136 BIO_Mem_Gamma_Decode (mem_bitio_state * bs, unsigned long *bits)
    137 {
    138   register unsigned long val;
     135mg_u_long
     136BIO_Mem_Gamma_Decode (mem_bitio_state * bs, mg_u_long *bits)
     137{
     138  register mg_u_long val;
    139139  DECODE_CONTINUE (*bs)
    140140    if (bits)
     
    150150
    151151void
    152 BIO_Mem_Delta_Encode (unsigned long val, mem_bitio_state * bs,
    153               unsigned long *bits)
     152BIO_Mem_Delta_Encode (mg_u_long val, mem_bitio_state * bs,
     153              mg_u_long *bits)
    154154{
    155155  ENCODE_CONTINUE (*bs)
     
    162162
    163163
    164 unsigned long
    165 BIO_Mem_Delta_Decode (mem_bitio_state * bs, unsigned long *bits)
    166 {
    167   register unsigned long val;
     164mg_u_long
     165BIO_Mem_Delta_Decode (mem_bitio_state * bs, mg_u_long *bits)
     166{
     167  register mg_u_long val;
    168168  DECODE_CONTINUE (*bs)
    169169    if (bits)
     
    176176
    177177void
    178 BIO_Mem_Elias_Encode (unsigned long val, unsigned long b, double s,
    179               mem_bitio_state * bs, unsigned long *bits)
     178BIO_Mem_Elias_Encode (mg_u_long val, mg_u_long b, double s,
     179              mem_bitio_state * bs, mg_u_long *bits)
    180180{
    181181  ENCODE_CONTINUE (*bs)
     
    188188
    189189
    190 unsigned long
    191 BIO_Mem_Elias_Decode (unsigned long b, double s,
    192               mem_bitio_state * bs, unsigned long *bits)
    193 {
    194   register unsigned long val;
     190mg_u_long
     191BIO_Mem_Elias_Decode (mg_u_long b, double s,
     192              mem_bitio_state * bs, mg_u_long *bits)
     193{
     194  register mg_u_long val;
    195195  DECODE_CONTINUE (*bs)
    196196    if (bits)
     
    203203
    204204void
    205 BIO_Mem_Bblock_Encode (unsigned long val, unsigned long b,
    206                mem_bitio_state * bs, unsigned long *bits)
     205BIO_Mem_Bblock_Encode (mg_u_long val, mg_u_long b,
     206               mem_bitio_state * bs, mg_u_long *bits)
    207207{
    208208  ENCODE_CONTINUE (*bs)
     
    215215
    216216
    217 unsigned long
    218 BIO_Mem_Bblock_Decode (unsigned long b, mem_bitio_state * bs,
    219                unsigned long *bits)
    220 {
    221   register unsigned long val;
     217mg_u_long
     218BIO_Mem_Bblock_Decode (mg_u_long b, mem_bitio_state * bs,
     219               mg_u_long *bits)
     220{
     221  register mg_u_long val;
    222222  DECODE_CONTINUE (*bs)
    223223    if (bits)
     
    230230
    231231void
    232 BIO_Mem_Decode_Seek (unsigned long pos, mem_bitio_state * bs)
     232BIO_Mem_Decode_Seek (mg_u_long pos, mem_bitio_state * bs)
    233233{
    234234  DECODE_CONTINUE (*bs)
  • main/trunk/greenstone2/common-src/indexers/mg/lib/bitio_mem.h

    r16583 r25147  
    6161
    6262
    63 void BIO_Mem_Unary_Encode (unsigned long val, mem_bitio_state * bs,
    64                unsigned long *bits);
    65 unsigned long BIO_Mem_Unary_Decode (mem_bitio_state * bs,
    66                     unsigned long *bits);
     63void BIO_Mem_Unary_Encode (mg_u_long val, mem_bitio_state * bs,
     64               mg_u_long *bits);
     65mg_u_long BIO_Mem_Unary_Decode (mem_bitio_state * bs,
     66                    mg_u_long *bits);
    6767
    6868
    6969
    70 void BIO_Mem_Binary_Encode (unsigned long val, unsigned long b,
    71                 mem_bitio_state * bs, unsigned long *bits);
    72 unsigned long BIO_Mem_Binary_Decode (unsigned long b, mem_bitio_state * bs,
    73                      unsigned long *bits);
     70void BIO_Mem_Binary_Encode (mg_u_long val, mg_u_long b,
     71                mem_bitio_state * bs, mg_u_long *bits);
     72mg_u_long BIO_Mem_Binary_Decode (mg_u_long b, mem_bitio_state * bs,
     73                     mg_u_long *bits);
    7474
    7575
    7676
    77 void BIO_Mem_Gamma_Encode (unsigned long val, mem_bitio_state * bs,
    78                unsigned long *bits);
    79 unsigned long BIO_Mem_Gamma_Decode (mem_bitio_state * bs, unsigned long *bits);
     77void BIO_Mem_Gamma_Encode (mg_u_long val, mem_bitio_state * bs,
     78               mg_u_long *bits);
     79mg_u_long BIO_Mem_Gamma_Decode (mem_bitio_state * bs, mg_u_long *bits);
    8080
    8181
    8282
    83 void BIO_Mem_Delta_Encode (unsigned long val, mem_bitio_state * bs,
    84                unsigned long *bits);
    85 unsigned long BIO_Mem_Delta_Decode (mem_bitio_state * bs, unsigned long *bits);
     83void BIO_Mem_Delta_Encode (mg_u_long val, mem_bitio_state * bs,
     84               mg_u_long *bits);
     85mg_u_long BIO_Mem_Delta_Decode (mem_bitio_state * bs, mg_u_long *bits);
    8686
    8787
    88 void BIO_Mem_Elias_Encode (unsigned long val, unsigned long b, double s,
    89                mem_bitio_state * bs, unsigned long *bits);
    90 unsigned long BIO_Mem_Elias_Decode (unsigned long b, double s,
    91                  mem_bitio_state * bs, unsigned long *bits);
     88void BIO_Mem_Elias_Encode (mg_u_long val, mg_u_long b, double s,
     89               mem_bitio_state * bs, mg_u_long *bits);
     90mg_u_long BIO_Mem_Elias_Decode (mg_u_long b, double s,
     91                 mem_bitio_state * bs, mg_u_long *bits);
    9292
    9393
    94 void BIO_Mem_Bblock_Encode (unsigned long val, unsigned long b,
    95                 mem_bitio_state * bs, unsigned long *bits);
    96 unsigned long BIO_Mem_Bblock_Decode (unsigned long b, mem_bitio_state * bs,
    97                      unsigned long *bits);
     94void BIO_Mem_Bblock_Encode (mg_u_long val, mg_u_long b,
     95                mem_bitio_state * bs, mg_u_long *bits);
     96mg_u_long BIO_Mem_Bblock_Decode (mg_u_long b, mem_bitio_state * bs,
     97                     mg_u_long *bits);
    9898
    9999
    100 void BIO_Mem_Decode_Seek (unsigned long pos, mem_bitio_state * bs);
     100void BIO_Mem_Decode_Seek (mg_u_long pos, mem_bitio_state * bs);
    101101
    102102
  • main/trunk/greenstone2/common-src/indexers/mg/lib/bitio_mems.c

    r16583 r25147  
    3030
    3131void
    32 BIO_Mems_Encode_Start (unsigned char *buf, unsigned long pos,
     32BIO_Mems_Encode_Start (unsigned char *buf, mg_u_long pos,
    3333               mems_bitio_state * bs)
    3434{
     
    4646
    4747void
    48 BIO_Mems_Decode_Start (unsigned char *buf, unsigned long pos,
     48BIO_Mems_Decode_Start (unsigned char *buf, mg_u_long pos,
    4949               mems_bitio_state * bs)
    5050{
     
    5757
    5858void
    59 BIO_Mems_Unary_Encode (unsigned long val, mems_bitio_state * bs,
    60                unsigned long *bits)
     59BIO_Mems_Unary_Encode (mg_u_long val, mems_bitio_state * bs,
     60               mg_u_long *bits)
    6161{
    6262  ENCODE_CONTINUE (*bs)
     
    6969
    7070
    71 unsigned long
     71mg_u_long
    7272BIO_Mems_Unary_Decode (mems_bitio_state * bs,
    73                unsigned long *bits)
    74 {
    75   register unsigned long val;
     73               mg_u_long *bits)
     74{
     75  register mg_u_long val;
    7676  DECODE_CONTINUE (*bs)
    7777    if (bits)
     
    9090
    9191void
    92 BIO_Mems_Binary_Encode (unsigned long val, unsigned long b,
    93             mems_bitio_state * bs, unsigned long *bits)
     92BIO_Mems_Binary_Encode (mg_u_long val, mg_u_long b,
     93            mems_bitio_state * bs, mg_u_long *bits)
    9494{
    9595  ENCODE_CONTINUE (*bs)
     
    102102
    103103
    104 unsigned long
    105 BIO_Mems_Binary_Decode (unsigned long b, mems_bitio_state * bs,
    106             unsigned long *bits)
    107 {
    108   register unsigned long val;
     104mg_u_long
     105BIO_Mems_Binary_Decode (mg_u_long b, mems_bitio_state * bs,
     106            mg_u_long *bits)
     107{
     108  register mg_u_long val;
    109109  DECODE_CONTINUE (*bs)
    110110    if (bits)
     
    123123
    124124void
    125 BIO_Mems_Gamma_Encode (unsigned long val, mems_bitio_state * bs,
    126                unsigned long *bits)
     125BIO_Mems_Gamma_Encode (mg_u_long val, mems_bitio_state * bs,
     126               mg_u_long *bits)
    127127{
    128128  ENCODE_CONTINUE (*bs)
     
    135135
    136136
    137 unsigned long
    138 BIO_Mems_Gamma_Decode (mems_bitio_state * bs, unsigned long *bits)
    139 {
    140   register unsigned long val;
     137mg_u_long
     138BIO_Mems_Gamma_Decode (mems_bitio_state * bs, mg_u_long *bits)
     139{
     140  register mg_u_long val;
    141141  DECODE_CONTINUE (*bs)
    142142    if (bits)
     
    152152
    153153void
    154 BIO_Mems_Delta_Encode (unsigned long val, mems_bitio_state * bs,
    155                unsigned long *bits)
     154BIO_Mems_Delta_Encode (mg_u_long val, mems_bitio_state * bs,
     155               mg_u_long *bits)
    156156{
    157157  ENCODE_CONTINUE (*bs)
     
    164164
    165165
    166 unsigned long
    167 BIO_Mems_Delta_Decode (mems_bitio_state * bs, unsigned long *bits)
    168 {
    169   register unsigned long val;
     166mg_u_long
     167BIO_Mems_Delta_Decode (mems_bitio_state * bs, mg_u_long *bits)
     168{
     169  register mg_u_long val;
    170170  DECODE_CONTINUE (*bs)
    171171    if (bits)
     
    178178
    179179void
    180 BIO_Mems_Elias_Encode (unsigned long val, unsigned long b, double s,
    181                mems_bitio_state * bs, unsigned long *bits)
     180BIO_Mems_Elias_Encode (mg_u_long val, mg_u_long b, double s,
     181               mems_bitio_state * bs, mg_u_long *bits)
    182182{
    183183  ENCODE_CONTINUE (*bs)
     
    190190
    191191
    192 unsigned long
    193 BIO_Mems_Elias_Decode (unsigned long b, double s,
    194                mems_bitio_state * bs, unsigned long *bits)
    195 {
    196   register unsigned long val;
     192mg_u_long
     193BIO_Mems_Elias_Decode (mg_u_long b, double s,
     194               mems_bitio_state * bs, mg_u_long *bits)
     195{
     196  register mg_u_long val;
    197197  DECODE_CONTINUE (*bs)
    198198    if (bits)
     
    205205
    206206void
    207 BIO_Mems_Bblock_Encode (unsigned long val, unsigned long b,
    208             mems_bitio_state * bs, unsigned long *bits)
     207BIO_Mems_Bblock_Encode (mg_u_long val, mg_u_long b,
     208            mems_bitio_state * bs, mg_u_long *bits)
    209209{
    210210  ENCODE_CONTINUE (*bs)
     
    217217
    218218
    219 unsigned long
    220 BIO_Mems_Bblock_Decode (unsigned long b, mems_bitio_state * bs,
    221             unsigned long *bits)
    222 {
    223   register unsigned long val;
     219mg_u_long
     220BIO_Mems_Bblock_Decode (mg_u_long b, mems_bitio_state * bs,
     221            mg_u_long *bits)
     222{
     223  register mg_u_long val;
    224224  DECODE_CONTINUE (*bs)
    225225    if (bits)
     
    232232
    233233void
    234 BIO_Mems_Decode_Seek (unsigned long pos, mems_bitio_state * bs)
     234BIO_Mems_Decode_Seek (mg_u_long pos, mems_bitio_state * bs)
    235235{
    236236  DECODE_CONTINUE (*bs)
     
    240240
    241241void
    242 BIO_Mems_Encode_Seek (unsigned long pos, mems_bitio_state * bs)
     242BIO_Mems_Encode_Seek (mg_u_long pos, mems_bitio_state * bs)
    243243{
    244244  ENCODE_CONTINUE (*bs)
  • main/trunk/greenstone2/common-src/indexers/mg/lib/bitio_mems.h

    r16583 r25147  
    3838  {
    3939    unsigned char *Base;
    40     unsigned long pos;
     40    mg_u_long pos;
    4141  }
    4242mems_bitio_state;
     
    4646
    4747
    48 void BIO_Mems_Encode_Start (char *buf, unsigned long pos, mems_bitio_state * bs);
     48void BIO_Mems_Encode_Start (char *buf, mg_u_long pos, mems_bitio_state * bs);
    4949void BIO_Mems_Encode_Done (mems_bitio_state * bs);
    5050
    5151
    5252
    53 void BIO_Mems_Decode_Start (void *buf, unsigned long pos, mems_bitio_state * bs);
     53void BIO_Mems_Decode_Start (void *buf, mg_u_long pos, mems_bitio_state * bs);
    5454
    5555
    5656
    57 void BIO_Mems_Unary_Encode (unsigned long val, mems_bitio_state * bs,
    58                 unsigned long *bits);
    59 unsigned long BIO_Mems_Unary_Decode (mems_bitio_state * bs,
    60                      unsigned long *bits);
     57void BIO_Mems_Unary_Encode (mg_u_long val, mems_bitio_state * bs,
     58                mg_u_long *bits);
     59mg_u_long BIO_Mems_Unary_Decode (mems_bitio_state * bs,
     60                     mg_u_long *bits);
    6161
    6262
    6363
    64 void BIO_Mems_Binary_Encode (unsigned long val, unsigned long b,
    65                  mems_bitio_state * bs, unsigned long *bits);
    66 unsigned long BIO_Mems_Binary_Decode (unsigned long b, mems_bitio_state * bs,
    67                       unsigned long *bits);
     64void BIO_Mems_Binary_Encode (mg_u_long val, mg_u_long b,
     65                 mems_bitio_state * bs, mg_u_long *bits);
     66mg_u_long BIO_Mems_Binary_Decode (mg_u_long b, mems_bitio_state * bs,
     67                      mg_u_long *bits);
    6868
    6969
    7070
    71 void BIO_Mems_Gamma_Encode (unsigned long val, mems_bitio_state * bs,
    72                 unsigned long *bits);
    73 unsigned long BIO_Mems_Gamma_Decode (mems_bitio_state * bs, unsigned long *bits);
     71void BIO_Mems_Gamma_Encode (mg_u_long val, mems_bitio_state * bs,
     72                mg_u_long *bits);
     73mg_u_long BIO_Mems_Gamma_Decode (mems_bitio_state * bs, mg_u_long *bits);
    7474
    7575
    7676
    77 void BIO_Mems_Delta_Encode (unsigned long val, mems_bitio_state * bs,
    78                 unsigned long *bits);
    79 unsigned long BIO_Mems_Delta_Decode (mems_bitio_state * bs, unsigned long *bits);
     77void BIO_Mems_Delta_Encode (mg_u_long val, mems_bitio_state * bs,
     78                mg_u_long *bits);
     79mg_u_long BIO_Mems_Delta_Decode (mems_bitio_state * bs, mg_u_long *bits);
    8080
    8181
    82 void BIO_Mems_Elias_Encode (unsigned long val, unsigned long b, double s,
    83                 mems_bitio_state * bs, unsigned long *bits);
    84 unsigned long BIO_Mems_Elias_Decode (unsigned long b, double s,
    85                 mems_bitio_state * bs, unsigned long *bits);
     82void BIO_Mems_Elias_Encode (mg_u_long val, mg_u_long b, double s,
     83                mems_bitio_state * bs, mg_u_long *bits);
     84mg_u_long BIO_Mems_Elias_Decode (mg_u_long b, double s,
     85                mems_bitio_state * bs, mg_u_long *bits);
    8686
    8787
    88 void BIO_Mems_Bblock_Encode (unsigned long val, unsigned long b,
    89                  mems_bitio_state * bs, unsigned long *bits);
    90 unsigned long BIO_Mems_Bblock_Decode (unsigned long b, mems_bitio_state * bs,
    91                       unsigned long *bits);
     88void BIO_Mems_Bblock_Encode (mg_u_long val, mg_u_long b,
     89                 mems_bitio_state * bs, mg_u_long *bits);
     90mg_u_long BIO_Mems_Bblock_Decode (mg_u_long b, mems_bitio_state * bs,
     91                      mg_u_long *bits);
    9292
    9393
    94 void BIO_Mems_Decode_Seek (unsigned long pos, mems_bitio_state * bs);
     94void BIO_Mems_Decode_Seek (mg_u_long pos, mems_bitio_state * bs);
    9595
    9696
  • main/trunk/greenstone2/common-src/indexers/mg/lib/bitio_random.c

    r16583 r25147  
    3030
    3131void
    32 BIO_Random_Start (FILE * f, unsigned long len,
     32BIO_Random_Start (FILE * f, mg_u_long len,
    3333          random_bitio_state * bs)
    3434{
     
    6464
    6565void
    66 BIO_Random_Unary_Encode (unsigned long val, random_bitio_state * bs,
    67              unsigned long *bits)
     66BIO_Random_Unary_Encode (mg_u_long val, random_bitio_state * bs,
     67             mg_u_long *bits)
    6868{
    6969  ENCODE_CONTINUE (*bs)
     
    7676
    7777
    78 unsigned long
     78mg_u_long
    7979BIO_Random_Unary_Decode (random_bitio_state * bs,
    80              unsigned long *bits)
    81 {
    82   register unsigned long val;
     80             mg_u_long *bits)
     81{
     82  register mg_u_long val;
    8383  DECODE_CONTINUE (*bs)
    8484    if (bits)
     
    9797
    9898void
    99 BIO_Random_Binary_Encode (unsigned long val, unsigned long b,
    100               random_bitio_state * bs, unsigned long *bits)
     99BIO_Random_Binary_Encode (mg_u_long val, mg_u_long b,
     100              random_bitio_state * bs, mg_u_long *bits)
    101101{
    102102  ENCODE_CONTINUE (*bs)
     
    109109
    110110
    111 unsigned long
    112 BIO_Random_Binary_Decode (unsigned long b,
     111mg_u_long
     112BIO_Random_Binary_Decode (mg_u_long b,
    113113              random_bitio_state * bs,
    114               unsigned long *bits)
    115 {
    116   register unsigned long val;
     114              mg_u_long *bits)
     115{
     116  register mg_u_long val;
    117117  DECODE_CONTINUE (*bs)
    118118    if (bits)
     
    131131
    132132void
    133 BIO_Random_Gamma_Encode (unsigned long val, random_bitio_state * bs,
    134              unsigned long *bits)
     133BIO_Random_Gamma_Encode (mg_u_long val, random_bitio_state * bs,
     134             mg_u_long *bits)
    135135{
    136136  ENCODE_CONTINUE (*bs)
     
    143143
    144144
    145 unsigned long
     145mg_u_long
    146146BIO_Random_Gamma_Decode (random_bitio_state * bs,
    147              unsigned long *bits)
    148 {
    149   register unsigned long val;
     147             mg_u_long *bits)
     148{
     149  register mg_u_long val;
    150150  DECODE_CONTINUE (*bs)
    151151    if (bits)
     
    161161
    162162void
    163 BIO_Random_Delta_Encode (unsigned long val, random_bitio_state * bs,
    164              unsigned long *bits)
     163BIO_Random_Delta_Encode (mg_u_long val, random_bitio_state * bs,
     164             mg_u_long *bits)
    165165{
    166166  ENCODE_CONTINUE (*bs)
     
    173173
    174174
    175 unsigned long
     175mg_u_long
    176176BIO_Random_Delta_Decode (random_bitio_state * bs,
    177              unsigned long *bits)
    178 {
    179   register unsigned long val;
     177             mg_u_long *bits)
     178{
     179  register mg_u_long val;
    180180  DECODE_CONTINUE (*bs)
    181181    if (bits)
     
    188188
    189189void
    190 BIO_Random_Elias_Encode (unsigned long val, unsigned long b, double s,
    191              random_bitio_state * bs, unsigned long *bits)
     190BIO_Random_Elias_Encode (mg_u_long val, mg_u_long b, double s,
     191             random_bitio_state * bs, mg_u_long *bits)
    192192{
    193193  ENCODE_CONTINUE (*bs)
     
    200200
    201201
    202 unsigned long
    203 BIO_Random_Elias_Decode (unsigned long b, double s,
     202mg_u_long
     203BIO_Random_Elias_Decode (mg_u_long b, double s,
    204204             random_bitio_state * bs,
    205              unsigned long *bits)
    206 {
    207   register unsigned long val;
     205             mg_u_long *bits)
     206{
     207  register mg_u_long val;
    208208  DECODE_CONTINUE (*bs)
    209209    if (bits)
     
    216216
    217217void
    218 BIO_Random_Bblock_Encode (unsigned long val, unsigned long b,
    219               random_bitio_state * bs, unsigned long *bits)
     218BIO_Random_Bblock_Encode (mg_u_long val, mg_u_long b,
     219              random_bitio_state * bs, mg_u_long *bits)
    220220{
    221221  ENCODE_CONTINUE (*bs)
     
    228228
    229229
    230 unsigned long
    231 BIO_Random_Bblock_Decode (unsigned long b,
     230mg_u_long
     231BIO_Random_Bblock_Decode (mg_u_long b,
    232232              random_bitio_state * bs,
    233               unsigned long *bits)
    234 {
    235   register unsigned long val;
     233              mg_u_long *bits)
     234{
     235  register mg_u_long val;
    236236  DECODE_CONTINUE (*bs)
    237237    if (bits)
     
    244244
    245245void
    246 BIO_Random_Seek (unsigned long pos, random_bitio_state * bs)
     246BIO_Random_Seek (mg_u_long pos, random_bitio_state * bs)
    247247{
    248248  ENCODE_CONTINUE (*bs)
     
    258258}
    259259
    260 unsigned long
     260mg_u_long
    261261BIO_Random_Tell (random_bitio_state * bs)
    262262{
    263   register unsigned long t;
     263  register mg_u_long t;
    264264  ENCODE_CONTINUE (*bs)
    265265    t = ENCODE_TELL;
     
    278278    ((((pos)+7) >> 3) < (mg_ullong)(__base + __len)))
    279279      {
    280     __pos = (long)((pos) - (mg_ullong)(__base << 3));
     280    __pos = (mg_s_long)((pos) - (mg_ullong)(__base << 3));
    281281      }
    282282    else
    283283      {
    284284        ENCODE_FLUSH;
    285     __base = (long)(((pos) >> (__sft+3)) << __sft);
     285    __base = (mg_s_long)(((pos) >> (__sft+3)) << __sft);
    286286   
    287287    fseek(__file,__base,0);
    288288    fread(__buf,1,__len,__file);
    289     __pos = (long)((pos) & ((8 << __sft)-1));
     289    __pos = (mg_s_long)((pos) & ((8 << __sft)-1));
    290290      }
    291291 
  • main/trunk/greenstone2/common-src/indexers/mg/lib/bitio_random.h

    r16583 r25147  
    4343    FILE *File;
    4444    unsigned char *Buf;
    45     unsigned long Base;
    46     unsigned long Used;
    47     unsigned long pos;
    48     unsigned long len;
    49     unsigned long sft;
     45    mg_u_long Base;
     46    mg_u_long Used;
     47    mg_u_long pos;
     48    mg_u_long len;
     49    mg_u_long sft;
    5050  }
    5151random_bitio_state;
     
    5555
    5656
    57 void BIO_Random_Start (FILE * f, unsigned long len,
     57void BIO_Random_Start (FILE * f, mg_u_long len,
    5858               random_bitio_state * bs);
    5959void BIO_Random_Done (random_bitio_state * bs);
     
    6161
    6262
    63 void BIO_Random_Decode_Start (void *buf, unsigned long pos,
     63void BIO_Random_Decode_Start (void *buf, mg_u_long pos,
    6464                  random_bitio_state * bs);
    6565
     
    6969
    7070
    71 void BIO_Random_Unary_Encode (unsigned long val, random_bitio_state * bs,
    72                   unsigned long *bits);
    73 unsigned long BIO_Random_Unary_Decode (random_bitio_state * bs,
    74                        unsigned long *bits);
     71void BIO_Random_Unary_Encode (mg_u_long val, random_bitio_state * bs,
     72                  mg_u_long *bits);
     73mg_u_long BIO_Random_Unary_Decode (random_bitio_state * bs,
     74                       mg_u_long *bits);
    7575
    7676
    7777
    78 void BIO_Random_Binary_Encode (unsigned long val, unsigned long b,
    79                    random_bitio_state * bs, unsigned long *bits);
    80 unsigned long BIO_Random_Binary_Decode (unsigned long b, random_bitio_state * bs,
    81                     unsigned long *bits);
     78void BIO_Random_Binary_Encode (mg_u_long val, mg_u_long b,
     79                   random_bitio_state * bs, mg_u_long *bits);
     80mg_u_long BIO_Random_Binary_Decode (mg_u_long b, random_bitio_state * bs,
     81                    mg_u_long *bits);
    8282
    8383
    8484
    85 void BIO_Random_Gamma_Encode (unsigned long val, random_bitio_state * bs,
    86                   unsigned long *bits);
    87 unsigned long BIO_Random_Gamma_Decode (random_bitio_state * bs,
    88                        unsigned long *bits);
     85void BIO_Random_Gamma_Encode (mg_u_long val, random_bitio_state * bs,
     86                  mg_u_long *bits);
     87mg_u_long BIO_Random_Gamma_Decode (random_bitio_state * bs,
     88                       mg_u_long *bits);
    8989
    9090
    9191
    92 void BIO_Random_Delta_Encode (unsigned long val, random_bitio_state * bs,
    93                   unsigned long *bits);
    94 unsigned long BIO_Random_Delta_Decode (random_bitio_state * bs,
    95                        unsigned long *bits);
     92void BIO_Random_Delta_Encode (mg_u_long val, random_bitio_state * bs,
     93                  mg_u_long *bits);
     94mg_u_long BIO_Random_Delta_Decode (random_bitio_state * bs,
     95                       mg_u_long *bits);
    9696
    9797
    98 void BIO_Random_Elias_Encode (unsigned long val, unsigned long b, double s,
    99                   random_bitio_state * bs, unsigned long *bits);
    100 unsigned long BIO_Random_Elias_Decode (unsigned long b, double s,
     98void BIO_Random_Elias_Encode (mg_u_long val, mg_u_long b, double s,
     99                  random_bitio_state * bs, mg_u_long *bits);
     100mg_u_long BIO_Random_Elias_Decode (mg_u_long b, double s,
    101101                       random_bitio_state * bs,
    102                        unsigned long *bits);
     102                       mg_u_long *bits);
    103103
    104104
    105 void BIO_Random_Bblock_Encode (unsigned long val, unsigned long b,
    106                    random_bitio_state * bs, unsigned long *bits);
    107 unsigned long BIO_Random_Bblock_Decode (unsigned long b,
     105void BIO_Random_Bblock_Encode (mg_u_long val, mg_u_long b,
     106                   random_bitio_state * bs, mg_u_long *bits);
     107mg_u_long BIO_Random_Bblock_Decode (mg_u_long b,
    108108                    random_bitio_state * bs,
    109                     unsigned long *bits);
     109                    mg_u_long *bits);
    110110
    111111
    112 void BIO_Random_Seek (unsigned long pos, random_bitio_state * bs);
     112void BIO_Random_Seek (mg_u_long pos, random_bitio_state * bs);
    113113
    114114void BIO_Random_Flush (random_bitio_state * bs);
    115115
    116 unsigned long BIO_Random_Tell (random_bitio_state * bs);
     116mg_u_long BIO_Random_Tell (random_bitio_state * bs);
    117117
    118118#ifdef USE_LONG_LONG
  • main/trunk/greenstone2/common-src/indexers/mg/lib/bitio_stdio.c

    r16583 r25147  
    7272
    7373void
    74 BIO_Stdio_Unary_Encode (unsigned long val, stdio_bitio_state * bs,
    75             unsigned long *bits)
     74BIO_Stdio_Unary_Encode (mg_u_long val, stdio_bitio_state * bs,
     75            mg_u_long *bits)
    7676{
    7777  ENCODE_CONTINUE (*bs)
     
    8484
    8585
    86 unsigned long
     86mg_u_long
    8787BIO_Stdio_Unary_Decode (stdio_bitio_state * bs,
    88             unsigned long *bits)
    89 {
    90   register unsigned long val;
     88            mg_u_long *bits)
     89{
     90  register mg_u_long val;
    9191  DECODE_CONTINUE (*bs)
    9292    if (bits)
     
    105105
    106106void
    107 BIO_Stdio_Binary_Encode (unsigned long val, unsigned long b,
    108              stdio_bitio_state * bs, unsigned long *bits)
     107BIO_Stdio_Binary_Encode (mg_u_long val, mg_u_long b,
     108             stdio_bitio_state * bs, mg_u_long *bits)
    109109{
    110110  ENCODE_CONTINUE (*bs)
     
    117117
    118118
    119 unsigned long
    120 BIO_Stdio_Binary_Decode (unsigned long b, stdio_bitio_state * bs,
    121              unsigned long *bits)
    122 {
    123   register unsigned long val;
     119mg_u_long
     120BIO_Stdio_Binary_Decode (mg_u_long b, stdio_bitio_state * bs,
     121             mg_u_long *bits)
     122{
     123  register mg_u_long val;
    124124  DECODE_CONTINUE (*bs)
    125125    if (bits)
     
    138138
    139139void
    140 BIO_Stdio_Gamma_Encode (unsigned long val, stdio_bitio_state * bs,
    141             unsigned long *bits)
     140BIO_Stdio_Gamma_Encode (mg_u_long val, stdio_bitio_state * bs,
     141            mg_u_long *bits)
    142142{
    143143  ENCODE_CONTINUE (*bs)
     
    150150
    151151
    152 unsigned long
     152mg_u_long
    153153BIO_Stdio_Gamma_Decode (stdio_bitio_state * bs,
    154             unsigned long *bits)
    155 {
    156   register unsigned long val;
     154            mg_u_long *bits)
     155{
     156  register mg_u_long val;
    157157  DECODE_CONTINUE (*bs)
    158158    if (bits)
     
    168168
    169169void
    170 BIO_Stdio_Delta_Encode (unsigned long val, stdio_bitio_state * bs,
    171             unsigned long *bits)
     170BIO_Stdio_Delta_Encode (mg_u_long val, stdio_bitio_state * bs,
     171            mg_u_long *bits)
    172172{
    173173  ENCODE_CONTINUE (*bs)
     
    180180
    181181
    182 unsigned long
     182mg_u_long
    183183BIO_Stdio_Delta_Decode (stdio_bitio_state * bs,
    184             unsigned long *bits)
    185 {
    186   register unsigned long val;
     184            mg_u_long *bits)
     185{
     186  register mg_u_long val;
    187187  DECODE_CONTINUE (*bs)
    188188    if (bits)
     
    198198
    199199void
    200 BIO_Stdio_Elias_Encode (unsigned long val, unsigned long b, double s,
    201             stdio_bitio_state * bs, unsigned long *bits)
     200BIO_Stdio_Elias_Encode (mg_u_long val, mg_u_long b, double s,
     201            stdio_bitio_state * bs, mg_u_long *bits)
    202202{
    203203  ENCODE_CONTINUE (*bs)
     
    210210
    211211
    212 unsigned long
    213 BIO_Stdio_Elias_Decode (unsigned long b, double s,
     212mg_u_long
     213BIO_Stdio_Elias_Decode (mg_u_long b, double s,
    214214            stdio_bitio_state * bs,
    215             unsigned long *bits)
    216 {
    217   register unsigned long val;
     215            mg_u_long *bits)
     216{
     217  register mg_u_long val;
    218218  DECODE_CONTINUE (*bs)
    219219    if (bits)
     
    228228
    229229void
    230 BIO_Stdio_Bblock_Encode (unsigned long val, unsigned long b,
    231              stdio_bitio_state * bs, unsigned long *bits)
     230BIO_Stdio_Bblock_Encode (mg_u_long val, mg_u_long b,
     231             stdio_bitio_state * bs, mg_u_long *bits)
    232232{
    233233  ENCODE_CONTINUE (*bs)
     
    240240
    241241
    242 unsigned long
    243 BIO_Stdio_Bblock_Decode (unsigned long b, stdio_bitio_state * bs,
    244              unsigned long *bits)
    245 {
    246   register unsigned long val;
     242mg_u_long
     243BIO_Stdio_Bblock_Decode (mg_u_long b, stdio_bitio_state * bs,
     244             mg_u_long *bits)
     245{
     246  register mg_u_long val;
    247247  DECODE_CONTINUE (*bs)
    248248    if (bits)
     
    255255
    256256void
    257 BIO_Stdio_Decode_Seek (unsigned long pos, stdio_bitio_state * bs)
     257BIO_Stdio_Decode_Seek (mg_u_long pos, stdio_bitio_state * bs)
    258258{
    259259  DECODE_CONTINUE (*bs)
  • main/trunk/greenstone2/common-src/indexers/mg/lib/bitio_stdio.h

    r16583 r25147  
    5959
    6060
    61 void BIO_Stdio_Unary_Encode (unsigned long val, stdio_bitio_state * bs,
    62                  unsigned long *bits);
    63 unsigned long BIO_Stdio_Unary_Decode (stdio_bitio_state * bs,
    64                       unsigned long *bits);
     61void BIO_Stdio_Unary_Encode (mg_u_long val, stdio_bitio_state * bs,
     62                 mg_u_long *bits);
     63mg_u_long BIO_Stdio_Unary_Decode (stdio_bitio_state * bs,
     64                      mg_u_long *bits);
    6565
    6666
    6767
    68 void BIO_Stdio_Binary_Encode (unsigned long val, unsigned long b,
    69                   stdio_bitio_state * bs, unsigned long *bits);
    70 unsigned long BIO_Stdio_Binary_Decode (unsigned long b, stdio_bitio_state * bs,
    71                        unsigned long *bits);
     68void BIO_Stdio_Binary_Encode (mg_u_long val, mg_u_long b,
     69                  stdio_bitio_state * bs, mg_u_long *bits);
     70mg_u_long BIO_Stdio_Binary_Decode (mg_u_long b, stdio_bitio_state * bs,
     71                       mg_u_long *bits);
    7272
    7373
    7474
    75 void BIO_Stdio_Gamma_Encode (unsigned long val, stdio_bitio_state * bs,
    76                  unsigned long *bits);
    77 unsigned long BIO_Stdio_Gamma_Decode (stdio_bitio_state * bs,
    78                       unsigned long *bits);
     75void BIO_Stdio_Gamma_Encode (mg_u_long val, stdio_bitio_state * bs,
     76                 mg_u_long *bits);
     77mg_u_long BIO_Stdio_Gamma_Decode (stdio_bitio_state * bs,
     78                      mg_u_long *bits);
    7979
    8080
    8181
    82 void BIO_Stdio_Delta_Encode (unsigned long val, stdio_bitio_state * bs,
    83                  unsigned long *bits);
    84 unsigned long BIO_Stdio_Delta_Decode (stdio_bitio_state * bs,
    85                       unsigned long *bits);
     82void BIO_Stdio_Delta_Encode (mg_u_long val, stdio_bitio_state * bs,
     83                 mg_u_long *bits);
     84mg_u_long BIO_Stdio_Delta_Decode (stdio_bitio_state * bs,
     85                      mg_u_long *bits);
    8686
    8787
    8888
    89 void BIO_Stdio_Elias_Encode (unsigned long val, unsigned long b, double s,
    90                  stdio_bitio_state * bs, unsigned long *bits);
    91 unsigned long BIO_Stdio_Elias_Decode (unsigned long b, double s,
     89void BIO_Stdio_Elias_Encode (mg_u_long val, mg_u_long b, double s,
     90                 stdio_bitio_state * bs, mg_u_long *bits);
     91mg_u_long BIO_Stdio_Elias_Decode (mg_u_long b, double s,
    9292                      stdio_bitio_state * bs,
    93                       unsigned long *bits);
     93                      mg_u_long *bits);
    9494
    9595
    96 void BIO_Stdio_Bblock_Encode (unsigned long val, unsigned long b,
    97                   stdio_bitio_state * bs, unsigned long *bits);
    98 unsigned long BIO_Stdio_Bblock_Decode (unsigned long b, stdio_bitio_state * bs,
    99                        unsigned long *bits);
     96void BIO_Stdio_Bblock_Encode (mg_u_long val, mg_u_long b,
     97                  stdio_bitio_state * bs, mg_u_long *bits);
     98mg_u_long BIO_Stdio_Bblock_Decode (mg_u_long b, stdio_bitio_state * bs,
     99                       mg_u_long *bits);
    100100
    101101
    102 void BIO_Stdio_Decode_Seek (unsigned long pos, stdio_bitio_state * bs);
     102void BIO_Stdio_Decode_Seek (mg_u_long pos, stdio_bitio_state * bs);
    103103
    104104#endif
  • main/trunk/greenstone2/common-src/indexers/mg/lib/filestats.c

    r16583 r25147  
    2828
    2929File *
    30 Fopen (char *name, char *mode, unsigned long magic)
     30Fopen (char *name, char *mode, mg_u_long magic)
    3131{
    3232  FILE *f;
    3333  File *F;
    34   unsigned long m;
     34  mg_u_long m;
    3535  if (!(f = fopen (name, mode)))
    3636    return (NULL);
     
    9090
    9191int
    92 Fseek (File * F, long offset, int ptrname)
     92Fseek (File * F, mg_s_long offset, int ptrname)
    9393{
    9494  int num;
  • main/trunk/greenstone2/common-src/indexers/mg/lib/filestats.h

    r16583 r25147  
    2323#define H_FILESTATS
    2424
     25#include "mglong.h"
    2526
    2627typedef struct FileStats
    2728  {
    28     unsigned long NumSeeks;
    29     unsigned long NumReads;
    30     unsigned long NumBytes;
     29    mg_u_long NumSeeks;
     30    mg_u_long NumReads;
     31    mg_u_long NumBytes;
    3132  }
    3233FileStats;
     
    4546
    4647/* if magic is 0 no magic number is read or written */
    47 File *Fopen (char *name, char *mode, unsigned long magic);
     48File *Fopen (char *name, char *mode, mg_u_long magic);
    4849
    4950size_t Fread (void *ptr, size_t size, size_t nitems, File * F);
    5051
    51 int Fseek (File * F, long offset, int ptrname);
     52int Fseek (File * F, mg_s_long offset, int ptrname);
    5253
    5354void Rewind (File * F);
  • main/trunk/greenstone2/common-src/indexers/mg/lib/gmalloc.c

    r16583 r25147  
    401401{
    402402  __ptr_t result;
    403   unsigned long int adj;
     403  mg_u_long adj;
    404404
    405405  result = (*__morecore) (size);
    406   adj = (unsigned long int) ((unsigned long int) ((char *) result -
     406  adj = (mg_u_long) ((mg_u_long) ((char *) result -
    407407                          (char *) NULL)) % BLOCKSIZE;
    408408  if (adj != 0)
     
    549549      block = BLOCK (result);
    550550      if (--_heapinfo[block].busy.info.frag.nfree != 0)
    551         _heapinfo[block].busy.info.frag.first = (unsigned long int)
    552           ((unsigned long int) ((char *) next->next - (char *) NULL)
     551        _heapinfo[block].busy.info.frag.first = (mg_u_long)
     552          ((mg_u_long) ((char *) next->next - (char *) NULL)
    553553           % BLOCKSIZE) >> log;
    554554
     
    872872      prev = (struct list *) ptr;
    873873      _heapinfo[block].busy.info.frag.nfree = 1;
    874       _heapinfo[block].busy.info.frag.first = (unsigned long int)
    875         ((unsigned long int) ((char *) ptr - (char *) NULL)
     874      _heapinfo[block].busy.info.frag.first = (mg_u_long)
     875        ((mg_u_long) ((char *) ptr - (char *) NULL)
    876876         % BLOCKSIZE >> type);
    877877      prev->next = _fraghead[type].next;
     
    12841284{
    12851285  __ptr_t result;
    1286   unsigned long int adj;
     1286  mg_u_long int adj;
    12871287
    12881288  size = ((size + alignment - 1) / alignment) * alignment;
     
    12911291  if (result == NULL)
    12921292    return NULL;
    1293   adj = (unsigned long int) ((unsigned long int) ((char *) result -
     1293  adj = (mg_u_long) ((mg_u_long) ((char *) result -
    12941294                          (char *) NULL)) % alignment;
    12951295  if (adj != 0)
  • main/trunk/greenstone2/common-src/indexers/mg/lib/huffman.c

    r16583 r25147  
    3030 */
    3131huff_data *
    32 Generate_Huffman_Data (int num, long *freqs, huff_data * data,
    33                u_long * mem)
     32Generate_Huffman_Data (int num, mg_s_long *freqs, huff_data * data,
     33               mg_u_long * mem)
    3434{
    3535  int HNum, i, count;
    36   unsigned long *heap;
     36  mg_u_long *heap;
    3737  huff_data *hd = data;
    3838  if (!hd)
     
    7373      if (heap[heap[curr - 1]] > heap[heap[child - 1]])
    7474        {
    75           register u_long temp;
     75          register mg_u_long temp;
    7676          temp = heap[child - 1];
    7777          heap[child - 1] = heap[curr - 1];
     
    141141
    142142  /* Calculate the code lens */
    143   heap[0] = -1UL;
     143  heap[0] = -1;
    144144  heap[1] = 0;
    145145  for (i = 2; i < num * 2; i++)
     
    154154  for (i = 0; i < num; i++)
    155155    {
    156       register u_long codelen = heap[i + num];
     156      register mg_u_long codelen = heap[i + num];
    157157      hd->clens[i] = (char) codelen;
    158158      if (!codelen)
     
    190190}
    191191
    192 unsigned long *
    193 Generate_Huffman_Codes (huff_data * data, u_long * mem)
     192mg_u_long *
     193Generate_Huffman_Codes (huff_data * data, mg_u_long * mem)
    194194{
    195195  int i;
    196   unsigned long *codes;
    197   unsigned long mc[MAX_HUFFCODE_LEN + 1];
     196  mg_u_long *codes;
     197  mg_u_long mc[MAX_HUFFCODE_LEN + 1];
    198198
    199199  if (!data)
     
    212212
    213213
    214 unsigned long **
    215 Generate_Huffman_Vals (huff_data * data, u_long * mem)
     214mg_u_long **
     215Generate_Huffman_Vals (huff_data * data, mg_u_long * mem)
    216216{
    217217  int i;
    218   unsigned long *fcode[MAX_HUFFCODE_LEN + 1];
    219   unsigned long **values;
    220   unsigned long *vals;
     218  mg_u_long *fcode[MAX_HUFFCODE_LEN + 1];
     219  mg_u_long **values;
     220  mg_u_long *vals;
    221221
    222222  if (!data)
     
    224224  if (!(vals = Xmalloc (data->num_codes * sizeof (*vals))))
    225225    return (NULL);
    226   if (!(values = Xmalloc ((MAX_HUFFCODE_LEN + 1) * sizeof (unsigned long *))))
     226  if (!(values = Xmalloc ((MAX_HUFFCODE_LEN + 1) * sizeof (mg_u_long *))))
    227227    {
    228228      free (vals);
     
    230230    }
    231231
    232   bzero ((char *) values, (MAX_HUFFCODE_LEN + 1) * sizeof (unsigned long *));
     232  bzero ((char *) values, (MAX_HUFFCODE_LEN + 1) * sizeof (mg_u_long *));
    233233
    234234  if (mem)
    235235    *mem += data->num_codes * sizeof (*vals) +
    236       (MAX_HUFFCODE_LEN + 1) * sizeof (unsigned long *);
     236      (MAX_HUFFCODE_LEN + 1) * sizeof (mg_u_long *);
    237237
    238238  fcode[0] = values[0] = &vals[0];
     
    249249
    250250double
    251 Calculate_Huffman_Size (int num, long *freqs, long *counts)
     251Calculate_Huffman_Size (int num, mg_s_long *freqs, mg_s_long *counts)
    252252{
    253253  double size = 0;
     
    321321static int
    322322General_Read_Huffman_Data (size_t (*rd) (), void *f,
    323                huff_data * hd, u_long * mem, u_long * disk)
     323               huff_data * hd, mg_u_long * mem, mg_u_long * disk)
    324324{
    325325  if (rd (&hd->num_codes, sizeof (hd->num_codes), 1, f) != 1)
     
    392392
    393393int
    394 Read_Huffman_Data (FILE * f, huff_data * hd, u_long * mem, u_long * disk)
     394Read_Huffman_Data (FILE * f, huff_data * hd, mg_u_long * mem, mg_u_long * disk)
    395395{
    396396  return General_Read_Huffman_Data (fread, f, hd, mem, disk);
     
    401401
    402402int
    403 F_Read_Huffman_Data (File * f, huff_data * hd, u_long * mem, u_long * disk)
     403F_Read_Huffman_Data (File * f, huff_data * hd, mg_u_long * mem, mg_u_long * disk)
    404404{
    405405  return General_Read_Huffman_Data (Fread, f, hd, mem, disk);
  • main/trunk/greenstone2/common-src/indexers/mg/lib/huffman.h

    r16583 r25147  
    3737    int maxcodelen;
    3838    int lencount[MAX_HUFFCODE_LEN + 1];
    39     unsigned long min_code[MAX_HUFFCODE_LEN + 1];
     39    mg_u_long min_code[MAX_HUFFCODE_LEN + 1];
    4040    char *clens;
    4141  }
     
    4343
    4444
    45 huff_data *Generate_Huffman_Data (int num, long *freqs, huff_data * data,
    46                   u_long * mem);
     45huff_data *Generate_Huffman_Data (int num, mg_s_long *freqs, huff_data * data,
     46                  mg_u_long * mem);
    4747
    48 unsigned long *Generate_Huffman_Codes (huff_data * data, u_long * mem);
     48mg_u_long *Generate_Huffman_Codes (huff_data * data, mg_u_long * mem);
    4949
    50 unsigned long **Generate_Huffman_Vals (huff_data * data, u_long * mem);
     50mg_u_long **Generate_Huffman_Vals (huff_data * data, mg_u_long * mem);
    5151
    5252int Write_Huffman_Data (FILE * f, huff_data * hd);
    5353
    54 int Read_Huffman_Data (FILE * f, huff_data * hd, u_long * mem, u_long * disk);
     54int Read_Huffman_Data (FILE * f, huff_data * hd, mg_u_long * mem, mg_u_long * disk);
    5555
    56 int F_Read_Huffman_Data (File * f, huff_data * hd, u_long * mem, u_long * disk);
     56int F_Read_Huffman_Data (File * f, huff_data * hd, mg_u_long * mem, mg_u_long * disk);
    5757
    5858/* Calculate the number of bits required to code the data with the
    5959   specified frequencies. Normally freqs and counts should point to
    6060   the same array. */
    61 double Calculate_Huffman_Size (int num, long *freqs, long *counts);
     61double Calculate_Huffman_Size (int num, mg_s_long *freqs, mg_s_long *counts);
    6262
    6363
     
    6767    register int __i;                           \
    6868    register int __clen = (lens)[x];                    \
    69     register unsigned long __code = (codes)[x];             \
     69    register mg_u_long __code = (codes)[x];             \
    7070    for (__i=__clen-1; __i>=0; --__i)                   \
    7171      ENCODE_BIT((__code >> __i) & 1);                  \
     
    8181#define HUFF_DECODE(x, mcodes, values)                  \
    8282  do {                                  \
    83     register unsigned long *__min_code = (mcodes);          \
    84     register unsigned long *__mclen = __min_code;           \
    85     register unsigned long **__values = (values);           \
    86     register unsigned long __code = 0;                  \
     83    register mg_u_long *__min_code = (mcodes);          \
     84    register mg_u_long *__mclen = __min_code;           \
     85    register mg_u_long **__values = (values);           \
     86    register mg_u_long __code = 0;                  \
    8787    do                                  \
    8888      {                                 \
     
    9696#define HUFF_DECODE_L(x, mcodes, values, count)             \
    9797  do {                                  \
    98     register unsigned long *__min_code = (mcodes);          \
    99     register unsigned long *__mclen = __min_code;           \
    100     register unsigned long **__values = (values);           \
    101     register unsigned long __code = 0;                  \
     98    register mg_u_long *__min_code = (mcodes);          \
     99    register mg_u_long *__mclen = __min_code;           \
     100    register mg_u_long **__values = (values);           \
     101    register mg_u_long __code = 0;                  \
    102102    do                                  \
    103103      {                                 \
  • main/trunk/greenstone2/common-src/indexers/mg/lib/huffman_mem.c

    r16583 r25147  
    3030
    3131void
    32 BIO_Mem_Huff_Encode (unsigned long val, unsigned long *codes,
     32BIO_Mem_Huff_Encode (mg_u_long val, mg_u_long *codes,
    3333             char *clens, mem_bitio_state * bs)
    3434{
     
    3838}
    3939
    40 unsigned long
    41 BIO_Mem_Huff_Decode (unsigned long *mincodes,
    42              unsigned long **values, mem_bitio_state * bs)
     40mg_u_long
     41BIO_Mem_Huff_Decode (mg_u_long *mincodes,
     42             mg_u_long **values, mem_bitio_state * bs)
    4343{
    44   unsigned long val;
     44  mg_u_long val;
    4545  DECODE_CONTINUE (*bs)
    4646    HUFF_DECODE (val, mincodes, values);
  • main/trunk/greenstone2/common-src/indexers/mg/lib/huffman_mem.h

    r16583 r25147  
    2525
    2626
    27 void BIO_Mem_Huff_Encode (unsigned long val, unsigned long *codes,
     27void BIO_Mem_Huff_Encode (mg_u_long val, mg_u_long *codes,
    2828              char *clens, mem_bitio_state * bs);
    2929
    30 unsigned long BIO_Mem_Huff_Decode (unsigned long *mincodes,
    31                   unsigned long **values, mem_bitio_state * bs);
     30mg_u_long BIO_Mem_Huff_Decode (mg_u_long *mincodes,
     31                  mg_u_long **values, mem_bitio_state * bs);
    3232
    3333
  • main/trunk/greenstone2/common-src/indexers/mg/lib/huffman_stdio.c

    r16583 r25147  
    3333
    3434void
    35 BIO_Stdio_Huff_Encode (unsigned long val, unsigned long *codes,
     35BIO_Stdio_Huff_Encode (mg_u_long val, mg_u_long *codes,
    3636               char *clens, stdio_bitio_state * bs)
    3737{
     
    4141}
    4242
    43 unsigned long
    44 BIO_Stdio_Huff_Decode (unsigned long *mincodes,
    45                unsigned long **values,
     43mg_u_long
     44BIO_Stdio_Huff_Decode (mg_u_long *mincodes,
     45               mg_u_long **values,
    4646               stdio_bitio_state * bs)
    4747{
    48   unsigned long val;
     48  mg_u_long val;
    4949  DECODE_CONTINUE (*bs)
    5050    HUFF_DECODE (val, mincodes, values);
  • main/trunk/greenstone2/common-src/indexers/mg/lib/huffman_stdio.h

    r16583 r25147  
    2525
    2626
    27 void BIO_Stdio_Huff_Encode (unsigned long val, unsigned long *codes,
     27void BIO_Stdio_Huff_Encode (mg_u_long val, mg_u_long *codes,
    2828                char *clens, stdio_bitio_state * bs);
    2929
    3030
    31 unsigned long BIO_Stdio_Huff_Decode (unsigned long *mincodes,
    32                      unsigned long **values,
     31mg_u_long BIO_Stdio_Huff_Decode (mg_u_long *mincodes,
     32                     mg_u_long **values,
    3333                     stdio_bitio_state * bs);
    3434
  • main/trunk/greenstone2/common-src/indexers/mg/lib/longlong.h

    r16583 r25147  
    2222#ifndef H_LONGLONG
    2323#define H_LONGLONG
     24
     25#include "mglong.h"
    2426
    2527#ifndef __WIN32__
     
    7173
    7274/* Not using GCC, so fall back on plain "long" (32-bit) types */
    73 typedef unsigned long int mg_ullong;
    74 typedef long int mg_llong;
     75typedef uint32_t mg_ullong;
     76typedef int32_t mg_llong;
    7577
    76 #define ULL_FS "lu"
    77 #define LL_FS "ld"
     78#define ULL_FS "u"
     79#define LL_FS "d"
    7880
    7981#endif /* __GNUC__ */
  • main/trunk/greenstone2/common-src/indexers/mg/lib/messages.c

    r16583 r25147  
    2828
    2929
    30 void VOLATILE
     30void
    3131FatalError (int ExitCode, const char *fmt,...)
    3232{
  • main/trunk/greenstone2/common-src/indexers/mg/lib/messages.h

    r16583 r25147  
    3131extern char *msg_prefix;
    3232
    33 void VOLATILE FatalError (int ExitCode, const char *fmt,...);
     33void FatalError (int ExitCode, const char *fmt,...);
    3434
    3535void Message (const char *fmt,...);
  • main/trunk/greenstone2/common-src/indexers/mg/lib/netorder.h

    r22257 r25147  
    1717#define HTOND(d)                                                                                  \
    1818        do {                                                                                      \
    19              unsigned long tmph, tmpl;                                                            \
     19             mg_u_long tmph, tmpl;                                                            \
    2020         bcopy ((char *) &d, (char *) &tmph, sizeof(double) >> 1);                            \
    2121         bcopy ((char *) &d + (sizeof(double) >> 1), (char *) &tmpl, sizeof (double) >> 1);   \
     
    2727#define NTOHD(d)                                                                                  \
    2828        do {                                                                                      \
    29              unsigned long tmph, tmpl;                                                            \
     29             mg_u_long tmph, tmpl;                                                            \
    3030         bcopy ((char *) &d, (char *) &tmph, sizeof(double) >> 1);                            \
    3131         bcopy ((char *) &d + (sizeof(double) >> 1), (char *) &tmpl, sizeof (double) >> 1);   \
     
    3737#define HTOND2(hd, nd)                                                                            \
    3838        do {                                                                                      \
    39              unsigned long tmph, tmpl;                                                            \
     39             mg_u_long tmph, tmpl;                                                            \
    4040         bcopy ((char *) &hd, (char *) &tmph, sizeof(double) >> 1);                           \
    4141         bcopy ((char *) &hd + (sizeof(double) >> 1), (char *) &tmpl, sizeof (double) >> 1);  \
     
    4747#define NTOHD2(nd, hd)                                                                            \
    4848        do {                                                                                      \
    49              unsigned long tmph, tmpl;                                                            \
     49             mg_u_long tmph, tmpl;                                                            \
    5050         bcopy ((char *) &nd, (char *) &tmph, sizeof(double) >> 1);                           \
    5151         bcopy ((char *) &nd + (sizeof(double) >> 1), (char *) &tmpl, sizeof (double) >> 1);  \
     
    5959#define HTONF(f)                                                                   \
    6060        do {                                                                       \
    61              unsigned long tmp;                                                    \
     61             mg_u_long tmp;                                                    \
    6262             bcopy ((char *) &(f), (char *) &tmp, sizeof (float));                 \
    6363             HTONUL (tmp);                                                         \
     
    6666#define NTOHF(f)                                                                   \
    6767        do {                                                                       \
    68              unsigned long tmp;                                                    \
     68             mg_u_long tmp;                                                    \
    6969             bcopy ((char *) &(f), (char *) &tmp, sizeof (float));                 \
    7070         NTOHUL (tmp);                                                         \
     
    7373#define HTONF2(hf, nf)                                                             \
    7474        do {                                                                       \
    75              unsigned long tmp;                                                    \
     75             mg_u_long tmp;                                                    \
    7676             bcopy ((char *) &(hf), (char *) &tmp, sizeof (float));                \
    7777             HTONUL (tmp);                                                         \
     
    8080#define NTOHF2(nf, hf)                                                             \
    8181        do {                                                                       \
    82              unsigned long tmp;                                                    \
     82             mg_u_long tmp;                                                    \
    8383             bcopy ((char *) &(nf), (char *) &tmp, sizeof (float));                \
    8484         NTOHUL (tmp);                                                         \
     
    115115
    116116/* pointers */
    117 #define HTONP(p)          ((p) = (void *) htonl ((unsigned long) p))
    118 #define NTOHP(p)          ((p) = (void *) ntohl ((unsigned long) p))
    119 #define HTONP2(hp, np)    ((np) = (void *) htonl ((unsigned long) hp))
    120 #define NTOHP2(np, hp)    ((hp) = (void *) ntohl ((unsigned long) np))
     117#define HTONP(p)          ((p) = (void *) htonl ((mg_u_long) p))
     118#define NTOHP(p)          ((p) = (void *) ntohl ((mg_u_long) p))
     119#define HTONP2(hp, np)    ((np) = (void *) htonl ((mg_u_long) hp))
     120#define NTOHP2(np, hp)    ((hp) = (void *) ntohl ((mg_u_long) np))
    121121
    122122/* unsigned long */
     
    127127
    128128/* signed long */
    129 #define HTONSL(l)         ((l) = (long) htonl ((unsigned long) (l)))
    130 #define NTOHSL(l)         ((l) = (long) ntohl ((unsigned long) (l)))
    131 #define HTONSL2(hl, nl)   ((nl) = (long) htonl ((unsigned long) (hl)))
    132 #define NTOHSL2(nl, hl)   ((hl) = (long) ntohl ((unsigned long) (nl)))
     129#define HTONSL(l)         ((l) = (mg_s_long) htonl ((mg_u_long) (l)))
     130#define NTOHSL(l)         ((l) = (mg_s_long) ntohl ((mg_u_long) (l)))
     131#define HTONSL2(hl, nl)   ((nl) = (mg_s_long) htonl ((mg_u_long) (hl)))
     132#define NTOHSL2(nl, hl)   ((hl) = (mg_s_long) ntohl ((mg_u_long) (nl)))
    133133
    134134/* unsigned int */
    135 #define HTONUI(i)         ((i) = (unsigned int) htonl ((unsigned long) (i)))
    136 #define NTOHUI(i)         ((i) = (unsigned int) ntohl ((unsigned long) (i)))
    137 #define HTONUI2(hi, ni)   ((ni) = (unsigned int) htonl ((unsigned long) (hi)))
    138 #define NTOHUI2(ni, hi)   ((hi) = (unsigned int) ntohl ((unsigned long) (ni)))
     135#define HTONUI(i)         ((i) = (unsigned int) htonl ((mg_u_long) (i)))
     136#define NTOHUI(i)         ((i) = (unsigned int) ntohl ((mg_u_long) (i)))
     137#define HTONUI2(hi, ni)   ((ni) = (unsigned int) htonl ((mg_u_long) (hi)))
     138#define NTOHUI2(ni, hi)   ((hi) = (unsigned int) ntohl ((mg_u_long) (ni)))
    139139
    140140/* signed int */
    141 #define HTONSI(i)         ((i) = (int) htonl ((unsigned long) (i)))
    142 #define NTOHSI(i)         ((i) = (int) ntohl ((unsigned long) (i)))
    143 #define HTONSI2(hi, ni)   ((ni) = (int) htonl ((unsigned long) (hi)))
    144 #define NTOHSI2(ni, hi)   ((hi) = (int) ntohl ((unsigned long) (ni)))
     141#define HTONSI(i)         ((i) = (int) htonl ((mg_u_long) (i)))
     142#define NTOHSI(i)         ((i) = (int) ntohl ((mg_u_long) (i)))
     143#define HTONSI2(hi, ni)   ((ni) = (int) htonl ((mg_u_long) (hi)))
     144#define NTOHSI2(ni, hi)   ((hi) = (int) ntohl ((mg_u_long) (ni)))
    145145
    146146/* unsigned short */
  • main/trunk/greenstone2/common-src/indexers/mg/lib/perf_hash.c

    r16583 r25147  
    4242
    4343/* Random Number stuff */
    44 static long seed[] = {0, 0};
     44static mg_s_long seed[] = {0, 0};
    4545#define RANDOM() irandm(seed)
    4646#define SEED_RANDOM(the_seed) do{ seed[0] = the_seed; }while(0)
     
    105105
    106106#ifndef STRUCT
    107 static long **tb0, **tb1, **tb2;
     107static mg_s_long **tb0, **tb1, **tb2;
    108108#else
    109109struct tb_entry **tb;
     
    128128{               /* deletes edge e from list of v */
    129129
    130   int b;
    131 
     130  int b, norm_b;
    132131  b = FIRST[v];
    133132  assert (norm (b) != 0);
     
    700699    {
    701700      if (tb0)
    702     if (!(tb0[i] = Xmalloc (sizeof (long) * MAX_L)))
     701    if (!(tb0[i] = Xmalloc (sizeof (mg_s_long) * MAX_L)))
    703702        ok = 0;
    704703      if (tb1)
    705     if (!(tb1[i] = Xmalloc (sizeof (long) * MAX_L)))
     704    if (!(tb1[i] = Xmalloc (sizeof (mg_s_long) * MAX_L)))
    706705        ok = 0;
    707706      if (tb2)
    708     if (!(tb2[i] = Xmalloc (sizeof (long) * MAX_L)))
     707    if (!(tb2[i] = Xmalloc (sizeof (mg_s_long) * MAX_L)))
    709708        ok = 0;
    710709    }
     
    744743
    745744  if (r <= 0)
    746     SEED_RANDOM ((long) time ((time_t *) NULL));
     745    SEED_RANDOM ((mg_s_long) time ((time_t *) NULL));
    747746  else
    748747    SEED_RANDOM (r);
     
    907906    {
    908907      if (phd->tb0)
    909     if (!(phd->tb0[i] = Xmalloc (sizeof (long) * phd->MAX_L)))
     908    if (!(phd->tb0[i] = Xmalloc (sizeof (mg_s_long) * phd->MAX_L)))
    910909        ok = 0;
    911910      if (phd->tb1)
    912     if (!(phd->tb1[i] = Xmalloc (sizeof (long) * phd->MAX_L)))
     911    if (!(phd->tb1[i] = Xmalloc (sizeof (mg_s_long) * phd->MAX_L)))
    913912        ok = 0;
    914913      if (phd->tb2)
    915     if (!(phd->tb2[i] = Xmalloc (sizeof (long) * phd->MAX_L)))
     914    if (!(phd->tb2[i] = Xmalloc (sizeof (mg_s_long) * phd->MAX_L)))
    916915        ok = 0;
    917916    }
     
    951950      int j;
    952951
    953       tot += fread ((char *) phd->tb0[i], sizeof (long), phd->MAX_L, f) *
     952      tot += fread ((char *) phd->tb0[i], sizeof (mg_s_long), phd->MAX_L, f) *
    954953        sizeof (int);
    955       tot += fread ((char *) phd->tb1[i], sizeof (long), phd->MAX_L, f) *
     954      tot += fread ((char *) phd->tb1[i], sizeof (mg_s_long), phd->MAX_L, f) *
    956955        sizeof (int);
    957       tot += fread ((char *) phd->tb2[i], sizeof (long), phd->MAX_L, f) *
     956      tot += fread ((char *) phd->tb2[i], sizeof (mg_s_long), phd->MAX_L, f) *
    958957        sizeof (int);
    959958
  • main/trunk/greenstone2/common-src/indexers/mg/lib/perf_hash.h

    r16583 r25147  
    2323#define H_PERF_HASH
    2424
    25 
    26 
     25#include "mglong.h"
    2726
    2827struct tb_entry
    2928  {
    30     long tb0, tb1, tb2;
     29    mg_s_long tb0, tb1, tb2;
    3130  };
    3231
  • main/trunk/greenstone2/common-src/indexers/mg/lib/random.c

    r16583 r25147  
    3333 *  The table mt[0:127] is defined by mt[i] = 69069 ** (128-i)
    3434 */
    35 
    36 #define MASK ((long) 593970775)
     35#include "random.h"
     36
     37#define MASK ((mg_s_long) 593970775)
    3738/*  or in hex, 23674657 */
    3839
     
    4041/*  i.e. 2 to power -31 */
    4142
    42 static long mt [128] =   {
     43static mg_s_long mt [128] =   {
    4344      902906369,
    4445     2030498053,
     
    172173
    173174double
    174 random (long is [2])
     175random (mg_s_long is [2])
    175176{
    176     long it, leh, nit;
     177    mg_s_long it, leh, nit;
    177178
    178179    it = is [0];
     
    187188    is [0] = it;    is [1] = leh;
    188189    if (leh < 0) leh = ~leh;
    189     return (SCALE * ((long) (leh | 1)));
     190    return (SCALE * ((mg_s_long) (leh | 1)));
    190191}
    191192
    192193
    193194
    194 long
    195 irandm (long is [2])
     195mg_s_long
     196irandm (mg_s_long is [2])
    196197{
    197     long it, leh, nit;
     198    mg_s_long it, leh, nit;
    198199
    199200    it = is [0];
  • main/trunk/greenstone2/common-src/indexers/mg/lib/random.h

    r16583 r25147  
    3636 *  The table mt[0:127] is defined by mt[i] = 69069 ** (128-i)
    3737 */
     38#include "mglong.h"
    3839
    39 double random (long is [2]);
    40 long irandm (long is [2]);
     40double random (mg_s_long is [2]);
     41mg_s_long irandm (mg_s_long is [2]);
    4142
    4243#endif
  • main/trunk/greenstone2/common-src/indexers/mg/lib/regex.c

    r16583 r25147  
    28962896  register char *fastmap = bufp->fastmap;
    28972897  unsigned char *pattern = bufp->buffer;
    2898   unsigned long size = bufp->used;
     2898  mg_u_long size = bufp->used;
    28992899  unsigned char *p = pattern;
    29002900  register unsigned char *pend = pattern + size;
  • main/trunk/greenstone2/common-src/indexers/mg/lib/regex.h

    r16583 r25147  
    292292
    293293    /* Number of bytes to which `buffer' points.  */
    294   unsigned long allocated;
     294  mg_u_long allocated;
    295295
    296296    /* Number of bytes actually used in `buffer'.  */
    297   unsigned long used;   
     297  mg_u_long used;   
    298298
    299299        /* Syntax setting with which the pattern was compiled.  */
  • main/trunk/greenstone2/common-src/indexers/mg/lib/rx.c

    r16583 r25147  
    615615
    616616#ifdef __STDC__
    617 RX_DECL unsigned long
     617RX_DECL mg_u_long
    618618rx_bitset_hash (int size, rx_Bitset b)
    619619#else
    620 RX_DECL unsigned long
     620RX_DECL mg_u_long
    621621rx_bitset_hash (size, b)
    622622     int size;
     
    625625{
    626626  int x;
    627   unsigned long hash = (unsigned long)rx_bitset_hash;
     627  uintptr_t hash = (uintptr_t)rx_bitset_hash;
    628628
    629629  for (x = rx_bitset_numb_subsets(size) - 1; x >= 0; --x)
     
    701701
    702702
    703 static unsigned long rx_hash_masks[4] =
     703static mg_u_long rx_hash_masks[4] =
    704704{
    705705  0x12488421,
     
    714714RX_DECL struct rx_hash_item *
    715715rx_hash_find (struct rx_hash * table,
    716           unsigned long hash,
     716          mg_u_long hash,
    717717          void * value,
    718718          struct rx_hash_rules * rules)
     
    721721rx_hash_find (table, hash, value, rules)
    722722     struct rx_hash * table;
    723      unsigned long hash;
     723     mg_u_long hash;
    724724     void * value;
    725725     struct rx_hash_rules * rules;
     
    728728  rx_hash_eq eq = rules->eq;
    729729  int maskc = 0;
    730   long mask = rx_hash_masks [0];
     730  mg_s_long mask = rx_hash_masks [0];
    731731  int bucket = (hash & mask) % 13;
    732732
     
    755755RX_DECL struct rx_hash_item *
    756756rx_hash_store (struct rx_hash * table,
    757            unsigned long hash,
     757           mg_u_long hash,
    758758           void * value,
    759759           struct rx_hash_rules * rules)
     
    762762rx_hash_store (table, hash, value, rules)
    763763     struct rx_hash * table;
    764      unsigned long hash;
     764     mg_u_long hash;
    765765     void * value;
    766766     struct rx_hash_rules * rules;
     
    769769  rx_hash_eq eq = rules->eq;
    770770  int maskc = 0;
    771   long mask = rx_hash_masks[0];
     771  mg_s_long mask = rx_hash_masks[0];
    772772  int bucket = (hash & mask) % 13;
    773773  int depth = 0;
     
    803803    {
    804804      struct rx_hash_item * them = table->buckets[bucket];
    805       unsigned long newmask = rx_hash_masks[maskc + 1];
     805      mg_u_long newmask = rx_hash_masks[maskc + 1];
    806806      while (them)
    807807        {
     
    855855    {
    856856      struct rx_hash * table = it->table;
    857       unsigned long hash = it->hash;
     857      mg_u_long hash = it->hash;
    858858      int depth = (table->parent
    859859           ? (table->parent->parent
     
    17751775         : (!vb
    17761776        ? 1
    1777         : ((long)a->car < (long)b->car
     1777        : ((intptr_t)a->car < (intptr_t)b->car
    17781778           ? 1
    1779            : ((long)a->car > (long)b->car
     1779           : ((intptr_t)a->car > (intptr_t)b->car
    17801780              ? -1
    17811781              : se_list_cmp ((void *)a->cdr, (void *)b->cdr))))));
     
    18421842#endif
    18431843{
    1844   long hash = (long)car ^ (long)cdr;
     1844  intptr_t hash = (intptr_t)car ^ (intptr_t)cdr;
    18451845  struct rx_se_list template;
    18461846
     
    19551955  template.cdr = set;
    19561956  node = rx_hash_store (memo,
    1957             (((long)state) >> 8) ^ (long)set,
     1957            (((intptr_t)state) >> 8) ^ (intptr_t)set,
    19581958            &template, &nfa_set_hash_rules);
    19591959  if (!node)
     
    22642264RX_DECL int
    22652265rx_compactify_nfa (struct rx *rx,
    2266            void **mem, unsigned long *size)
     2266           void **mem, mg_u_long *size)
    22672267#else
    22682268RX_DECL int
     
    22702270     struct rx *rx;
    22712271     void **mem;
    2272      unsigned long *size;
     2272     mg_u_long *size;
    22732273#endif
    22742274{
     
    22792279  int se_list_consc = count_hash_nodes (&rx->se_list_memo);
    22802280  int nfa_setc = count_hash_nodes (&rx->set_list_memo);
    2281   unsigned long total_size;
     2281  mg_u_long total_size;
    22822282
    22832283  /* This takes place in two stages.   First, the total size of the
     
    24072407          {
    24082408        sp = rx_hash_find (&rx->se_list_memo,
    2409                    (long)sesrc->car ^ (long)sesrc->cdr,
     2409                   (intptr_t)sesrc->car ^ (intptr_t)sesrc->cdr,
    24102410                   sesrc, &se_list_hash_rules);
    24112411        if (sp->binding)
     
    24252425          {
    24262426        sp = rx_hash_find (&rx->set_list_memo,
    2427                    ((((long)destlst->car) >> 8)
    2428                     ^ (long)destlst->cdr),
     2427                   ((((intptr_t)destlst->car) >> 8)
     2428                    ^ (intptr_t)destlst->cdr),
    24292429                   destlst, &nfa_set_hash_rules);
    24302430        if (sp->binding)
     
    27982798    (rx_hash_find
    27992799     (&cache->superset_table,
    2800       (unsigned long)set->car ^ set->id ^ (unsigned long)set->cdr,
     2800      (intptr_t)set->car ^ set->id ^ (intptr_t)set->cdr,
    28012801      (void *)set,
    28022802      &cache->superset_hash_rules),
     
    30563056    = ((struct rx_cache *)
    30573057       ((char *)rules
    3058     - (unsigned long)(&((struct rx_cache *)0)->superset_hash_rules)));
     3058    - (intptr_t)(&((struct rx_cache *)0)->superset_hash_rules)));
    30593059  struct rx_superset * template = (struct rx_superset *)val;
    30603060  struct rx_superset * newset
     
    30883088    = ((struct rx_cache *)
    30893089       ((char *)rules
    3090     - (unsigned long)(&((struct rx_cache *)0)->superset_hash_rules)));
     3090    - (intptr_t)(&((struct rx_cache *)0)->superset_hash_rules)));
    30913091  return ((struct rx_hash *)
    30923092      rx_cache_malloc_or_get (cache,
     
    31073107  struct rx_cache * cache
    31083108    = ((struct rx_cache *)
    3109        (char *)rules - (long)(&((struct rx_cache *)0)->superset_hash_rules));
     3109       (char *)rules - (intptr_t)(&((struct rx_cache *)0)->superset_hash_rules));
    31103110  rx_cache_free (cache, &cache->free_hash, (char *)hash);
    31113111}
     
    32643264    template.id = car->id;
    32653265    hit = rx_hash_store (&cache->superset_table,
    3266              (unsigned long)car ^ car->id ^ (unsigned long)cdr,
     3266             (intptr_t)car ^ car->id ^ (intptr_t)cdr,
    32673267             (void *)&template,
    32683268             &cache->superset_hash_rules);
     
    43324332    return;
    43334333      case r_side_effect:
    4334     if (   ((long)rexp->params.side_effect >= 0)
    4335         && (params [(long)rexp->params.side_effect].se == re_se_backref))
    4336       out[ params [(long)rexp->params.side_effect].op1] = 1;
     4334    if (   ((intptr_t)rexp->params.side_effect >= 0)
     4335        && (params [(intptr_t)rexp->params.side_effect].se == re_se_backref))
     4336      out[ params [(intptr_t)rexp->params.side_effect].op1] = 1;
    43374337    return;
    43384338      }
     
    45164516      case r_side_effect:
    45174517    {
    4518       int se = (long)rexp->params.side_effect;
     4518      int se = (intptr_t)rexp->params.side_effect;
    45194519      if (   (se >= 0)
    45204520          && (   ((enum re_side_effects)params[se].se == re_se_lparen)
     
    45634563      return pointless_if_repeated (node->params.pair.left, params);
    45644564    case r_side_effect:
    4565       switch ((enum re_side_effects) (((long)node->params.side_effect < 0)
    4566           ? (enum re_side_effects) (long) node->params.side_effect
    4567           : (enum re_side_effects)params[(long)node->params.side_effect].se))
     4565      switch ((enum re_side_effects) (((intptr_t)node->params.side_effect < 0)
     4566          ? (enum re_side_effects) (intptr_t) node->params.side_effect
     4567          : (enum re_side_effects)params[(intptr_t)node->params.side_effect].se))
    45684568    {
    45694569    case re_se_try:
     
    45884588    case re_se_backref:
    45894589      return 0;
     4590    case re_se_pushback:
     4591    case re_se_push0:
     4592    case re_se_pushpos:
     4593    case re_se_chkpos:
     4594    case re_se_poppos:
     4595    case re_se_tv:
     4596    case re_floogle_flap:
     4597      return -1;
    45904598    }
    45914599    case r_data:
     
    46374645      case r_side_effect:
    46384646    {
    4639       int se = (long)rexp->params.side_effect;
     4647      int se = (intptr_t)rexp->params.side_effect;
    46404648      if (   in_danger
    46414649          && (se >= 0)
     
    47574765    case r_side_effect:
    47584766      return
    4759     !((long)rexp->params.side_effect > 0
    4760       ? idempotent_complex_se [ params [(long)rexp->params.side_effect].se ]
    4761       : idempotent_se [-(long)rexp->params.side_effect]);
     4767    !((intptr_t)rexp->params.side_effect > 0
     4768      ? idempotent_complex_se [ params [(intptr_t)rexp->params.side_effect].se ]
     4769      : idempotent_se [-(intptr_t)rexp->params.side_effect]);
    47624770     
    47634771    case r_alternate:
     
    48114819
    48124820    case r_side_effect:
    4813       return ((long)rexp->params.side_effect >= 0);
     4821      return ((intptr_t)rexp->params.side_effect >= 0);
    48144822     
    48154823    case r_alternate:
     
    52045212          if (need_sync)
    52055213        {
    5206           int sync_se = paramc;
     5214          intptr_t sync_se = paramc;
    52075215          params = (params
    52085216                ? ((struct re_se_params *)
     
    55525560            handle_close:
    55535561              /* See similar code for backslashed left paren above.  */
    5554               if (COMPILE_STACK_EMPTY)
    5555                 if (syntax & RE_UNMATCHED_RIGHT_PAREN_ORD)
     5562              if (COMPILE_STACK_EMPTY){
     5563                if (syntax & RE_UNMATCHED_RIGHT_PAREN_ORD){
    55565564                  goto normal_char;
    5557                 else
     5565        }
     5566                else{
    55585567                  return REG_ERPAREN;
     5568        }
     5569          }
    55595570
    55605571              /* Since we just checked for an empty stack above, this
     
    55735584                this_group_regnum = COMPILE_STACK_TOP.regnum;
    55745585        {
    5575           int left_se = paramc;
    5576           int right_se = paramc + 1;
     5586          intptr_t left_se = paramc;
     5587          intptr_t right_se = paramc + 1;
    55775588
    55785589          params = (params
     
    56255636        last_expression = &alt->params.pair.right;
    56265637        {
    5627           int sync_se = paramc;
     5638          intptr_t sync_se = paramc;
    56285639
    56295640          params = (params
     
    57425753          /* Otherwise, we have a nontrivial interval. */
    57435754          {
    5744             int iter_se = paramc;
    5745             int end_se = paramc + 1;
     5755            intptr_t iter_se = paramc;
     5756            intptr_t end_se = paramc + 1;
    57465757            params = (params
    57475758                  ? ((struct re_se_params *)
     
    59395950
    59405951          {
    5941         int backref_se = paramc;
     5952        intptr_t backref_se = paramc;
    59425953        params = (params
    59435954              ? ((struct re_se_params *)
     
    60096020 
    60106021  {
    6011     int win_se = paramc;
     6022    intptr_t win_se = paramc;
    60126023    params = (params
    60136024          ? ((struct re_se_params *)
     
    61496160      {
    61506161    void * mem = (void *)rxb->buffer;
    6151     unsigned long size = rxb->allocated;
     6162    mg_u_long size = rxb->allocated;
    61526163    int start_id;
    61536164    char * perm_mem;
     
    67576768  while (list)
    67586769    {
    6759       if ((long)list->car >= 0)
     6770      if ((intptr_t)list->car >= 0)
    67606771    ++x;
    67616772      list = list->cdr;
     
    68126823      for (ai = al - 1; ai >= 0; --ai)
    68136824    {
    6814       while ((long)ap->car < 0)
     6825      while ((intptr_t)ap->car < 0)
    68156826        ap = ap->cdr;
    68166827      av[ai] = ap->car;
     
    68206831      for (bi = bl - 1; bi >= 0; --bi)
    68216832    {
    6822       while ((long)bp->car < 0)
     6833      while ((intptr_t)bp->car < 0)
    68236834        bp = bp->cdr;
    68246835      bv[bi] = bp->car;
  • main/trunk/greenstone2/common-src/indexers/mg/lib/rx.h

    r16583 r25147  
    2222/*  t. lord Wed Sep 23 18:20:57 1992    */
    2323
    24 
    25 
    26 
    27 
    28 
    29 
    30 
     24#include "mglong.h"
    3125
    3226#ifndef RX_WANT_SE_DEFS
     
    9185  struct rx_hash_item * next_same_hash;
    9286  struct rx_hash * table;
    93   unsigned long hash;
     87  mg_u_long hash;
    9488  void * data;
    9589  void * binding;
     
    273267   */
    274268  void * buffer;
    275   unsigned long allocated;
     269  mg_u_long allocated;
    276270
    277271  /* Clients of RX can ask for some extra storage in the space pointed
     
    280274   * at (buffer + allocated - reserved)
    281275   */
    282   unsigned long reserved;
     276  mg_u_long reserved;
    283277
    284278  /* --------- The remaining fields are for internal use only. --------- */
     
    12741268
    12751269  void * buffer;        /* Malloced memory for the nfa. */
    1276   unsigned long allocated;  /* Size of that memory. */
     1270  mg_u_long allocated;  /* Size of that memory. */
    12771271
    12781272  /* Pointer to a fastmap, if any, otherwise zero.  re_search uses
     
    15801574                      rx_Bitset a, rx_Bitset b);
    15811575RX_DECL void rx_bitset_xor (int size, rx_Bitset a, rx_Bitset b);
    1582 RX_DECL unsigned long rx_bitset_hash (int size, rx_Bitset b);
     1576RX_DECL mg_u_long rx_bitset_hash (int size, rx_Bitset b);
    15831577RX_DECL struct rx_hash_item * rx_hash_find (struct rx_hash * table,
    1584                         unsigned long hash,
     1578                        mg_u_long hash,
    15851579                        void * value,
    15861580                        struct rx_hash_rules * rules);
    15871581RX_DECL struct rx_hash_item * rx_hash_store (struct rx_hash * table,
    1588                          unsigned long hash,
     1582                         mg_u_long hash,
    15891583                         void * value,
    15901584                         struct rx_hash_rules * rules);
     
    16371631RX_DECL void rx_delete_epsilon_transitions (struct rx *rx);
    16381632RX_DECL int rx_compactify_nfa (struct rx *rx,
    1639                    void **mem, unsigned long *size);
     1633                   void **mem, mg_u_long *size);
    16401634RX_DECL void rx_release_superset (struct rx *rx,
    16411635                  struct rx_superset *set);
     
    16651659RX_DECL void rx_bitset_revdifference ();
    16661660RX_DECL void rx_bitset_xor ();
    1667 RX_DECL unsigned long rx_bitset_hash ();
     1661RX_DECL mg_u_long rx_bitset_hash ();
    16681662RX_DECL struct rx_hash_item * rx_hash_find ();
    16691663RX_DECL struct rx_hash_item * rx_hash_store ();
     
    22302224
    22312225
    2232 
    22332226/* How many characters in the character set.  */
    22342227#define CHAR_SET_SIZE (1 << CHARBITS)
     
    23442337RX_DECL __inline__ int
    23452338rx_search  (struct re_pattern_buffer * rxb,
    2346         int startpos,
     2339        intptr_t startpos,
    23472340        int range,
    23482341        int stop,
     
    23612354        app_closure, regs, resume_state, save_state)
    23622355     struct re_pattern_buffer * rxb;
    2363      int startpos;
     2356     intptr_t startpos;
    23642357     int range;
    23652358     int stop;
     
    27392732  {
    27402733    enum rx_test_match_entry test_pc;
    2741     int inx;
     2734    intptr_t inx;
    27422735    test_pc = search_state.test_match_resume_pt;
    27432736    if (test_pc == rx_test_start)
     
    28392832            ((struct rx_superstate *)
    28402833             ((char *)this_tr_table
    2841               - ((unsigned long)
     2834              - ((mg_u_long)
    28422835             ((struct rx_superstate *)0)->transitions)));
    28432836         
     
    29042897        ((struct rx_superstate *)
    29052898         ((char *)this_tr_table
    2906           - ((unsigned long)
     2899          - ((uintptr_t)
    29072900         ((struct rx_superstate *)0)->transitions)));
    29082901    }
     
    29112904     * Dispatch that instruction:
    29122905     */
    2913     inx = (int)search_state.ifr->inx;
     2906    inx = (intptr_t)search_state.ifr->inx;
    29142907#ifdef RX_DEBUG_0
    29152908    if (rx_debug_trace)
     
    29492942          while (el)
    29502943        {
    2951           long effect;
    2952           effect = (long)el->car;
     2944          intptr_t effect;
     2945          effect = (intptr_t)el->car;
    29532946          if (effect < 0)
    29542947            {
     
    29902983                = ((struct rx_superstate *)
    29912984                   ((char *)search_state.ifr->data
    2992                 - (long)(((struct rx_superstate *)0)
     2985                - (intptr_t)(((struct rx_superstate *)0)
    29932986                     ->transitions)));
    29942987              goto top_of_cycle;
  • main/trunk/greenstone2/common-src/indexers/mg/lib/sptree.c

    r16583 r25147  
    293293        q->par = p;             \
    294294        q->rght = p->left;          \
    295         if(q->rght)             \
    296             q->rght->par = q;       \
     295        if(q->rght){                \
     296          q->rght->par = q;         \
     297        }                                       \
    297298        p->left = q;                \
    298         if(p->par)              \
    299             if(q == p->par->left)       \
    300                 p->par->left = p;   \
    301             else                \
    302                 p->par->rght = p;   \
     299        if(p->par){             \
     300          if(q == p->par->left){        \
     301            p->par->left = p;           \
     302          }                                     \
     303          else{                 \
     304            p->par->rght = p;           \
     305          }                                     \
     306        }                                       \
    303307    }while(0)
    304308
     
    308312        q->par = p;             \
    309313        q->left = p->rght;          \
    310         if(q->left)             \
    311             q->left->par = q;       \
     314        if(q->left){                \
     315          q->left->par = q;         \
     316        }                                       \
    312317        p->rght = q;                \
    313         if(p->par)              \
    314             if(q == p->par->left)       \
    315                 p->par->left = p;   \
    316             else                \
    317                 p->par->rght = p;   \
     318        if(p->par){             \
     319          if(q == p->par->left){        \
     320            p->par->left = p;           \
     321          }                                     \
     322          else{                             \
     323            p->par->rght = p;           \
     324          }                                     \
     325        }                                       \
    318326    }while(0)
    319327
     
    341349      if (p == q->left)
    342350    {
    343       if (g == NNULL)
     351      if (g == NNULL){
    344352        ROTATER (p, q);
     353      }
    345354      else if (q == g->left)
    346355        {
     
    356365      else
    357366    {
    358       if (g == NNULL)
     367      if (g == NNULL){
    359368        ROTATEL (p, q);
     369      }
    360370      else if (q == g->rght)
    361371        {
  • main/trunk/greenstone2/common-src/indexers/mg/lib/sptree.h

    r16583 r25147  
    2929  {
    3030    int no_of_items;
    31     unsigned long mem_in_use;
     31    mg_u_long mem_in_use;
    3232    int (*cmp) (void *, void *);
    3333    void *root;
  • main/trunk/greenstone2/common-src/indexers/mg/lib/unitool.c

    r23431 r25147  
    1515 * column
    1616 */
    17 unsigned long *unicode_cat_data=NULL;
     17mg_u_long *unicode_cat_data=NULL;
    1818
    1919
     
    14641464 * column
    14651465 */
    1466 unsigned long *unicode_cat_data;
     1466mg_u_long *unicode_cat_data;
    14671467
    14681468void create_unicat_data () {
     
    14701470  int min_start=0;
    14711471  int min_end=0;
    1472   register unsigned long min_value=0; /* filling the whole byte */
     1472  register mg_u_long min_value=0; /* filling the whole byte */
    14731473 
    14741474  const unirange *letter_here = letter_info;
     
    15291529   
    15301530      } else {
    1531     register unsigned long mask = 3 << ((i % 16) * 2);
     1531    register mg_u_long mask = 3 << ((i % 16) * 2);
    15321532    unicode_cat_data[i/16] = (unicode_cat_data[i/16] & (~mask)) |
    15331533                  (min_value & mask);
  • main/trunk/greenstone2/common-src/indexers/mg/lib/win32in.c

    r16583 r25147  
    44/* unix systems. */
    55
    6 unsigned long htonl(unsigned long x) {
     6mg_u_long htonl(mg_u_long x) {
    77#if defined (LITTLE_ENDIAN) || defined (_LITTLE_ENDIAN) || defined(__LITTLE_ENDIAN)
    88    x = ((x >> 24) & 0x000000FF) | ((x >> 8) & 0x0000FF00) |
     
    2525}
    2626
    27 unsigned long ntohl(unsigned long x) {
     27mg_u_long ntohl(mg_u_long x) {
    2828#if defined (LITTLE_ENDIAN) || defined (_LITTLE_ENDIAN) || defined(__LITTLE_ENDIAN)
    2929    x = ((x >> 24) & 0x000000FF) | ((x >> 8) & 0x0000FF00) |
     
    5151
    5252main () {
    53     long x;
     53    mg_s_long x;
    5454    short sx;
    5555
  • main/trunk/greenstone2/common-src/indexers/mg/lib/win32in.h

    r16583 r25147  
    44#include "longlong.h"
    55
    6 unsigned long htonl(unsigned long x);
    7 unsigned long ntohl(unsigned long x);
     6mg_u_long htonl(mg_u_long x);
     7mg_u_long ntohl(mg_u_long x);
    88mg_ullong ntohll(mg_ullong x);
    99unsigned short htons(unsigned short x);
  • main/trunk/greenstone2/common-src/indexers/mg/src/images/Makefile.in

    r16583 r25147  
    3636 
    3737CC = @CC@
    38 CFLAGS = @CFLAGS@  @COMPAT32BITFLAGS@
     38CFLAGS = @CFLAGS@
    3939CPPFLAGS = @CPPFLAGS@
    4040DEFS = @DEFS@
     
    4242INSTALL_DATA = @INSTALL_DATA@
    4343INSTALL_PROGRAM = @INSTALL_PROGRAM@
    44 LDFLAGS = @LDFLAGS@ @COMPAT32BITFLAGS@
     44LDFLAGS = @LDFLAGS@
    4545LIBS = ../../lib/libmglib.a @LIBS@
    4646TOUCH = echo timestamp >
  • main/trunk/greenstone2/common-src/indexers/mg/src/images/mgfelics.c

    r16583 r25147  
    5555  FILE *fp_in = (stdin), *fp_out = (stdout);
    5656  int width, height, maxval;
    57   u_long magic;
     57  mg_u_long magic;
    5858  char *filename = NULL;
    5959  unsigned int *line;
  • main/trunk/greenstone2/common-src/indexers/mg/src/images/pbmtools.c

    r16583 r25147  
    6464pbm_isapbmfile (FILE * fp)
    6565{
    66   u_long magic;
     66  mg_u_long magic;
    6767
    6868  magic = getmagicno_short (fp);
  • main/trunk/greenstone2/common-src/indexers/mg/src/images/utils.c

    r16583 r25147  
    230230
    231231void
    232 magic_write (FILE * fp, u_long magic_num)
     232magic_write (FILE * fp, mg_u_long magic_num)
    233233{
    234234  HTONUL(magic_num);  /* [RPAP - Jan 97: Endian Ordering] */
     
    239239
    240240void
    241 magic_check (FILE * fp, u_long magic_num)
    242 {
    243   u_long magic;
     241magic_check (FILE * fp, mg_u_long magic_num)
     242{
     243  mg_u_long magic;
    244244  if (fread (&magic, sizeof (magic), 1, fp) != 1 || NTOHUL(magic) != magic_num)  /* [RPAP - Jan 97: Endian Ordering] */
    245245    error_msg ("magic num", "Incorrect magic number.", "");
     
    247247
    248248
    249 u_long
     249mg_u_long
    250250magic_read (FILE * fp)
    251251{
    252   u_long magic;
     252  mg_u_long magic;
    253253  if (fread (&magic, sizeof (magic), 1, fp) != 1)
    254254    error_msg ("magic num", "Couldn't read magic number.", "");
  • main/trunk/greenstone2/common-src/indexers/mg/src/images/utils.h

    r16583 r25147  
    4545#define MAGIC_BILEVEL           GEN_MAGIC('M','G','B','I')
    4646#define MAGIC_TIC               GEN_MAGIC('M','G','T','C')
    47 #define IS_MAGIC(a) ((((u_long)(a)) & 0xffff0000) == MAGIC_XXXX)
     47#define IS_MAGIC(a) ((((mg_u_long)(a)) & 0xffff0000) == MAGIC_XXXX)
    4848/* --------------------------------------- */
    4949
     
    6868void readline (char str[], FILE * fp);
    6969
    70 void magic_write (FILE * fp, u_long magic_num);
    71 void magic_check (FILE * fp, u_long magic_num);
    72 u_long magic_read (FILE * fp);
     70void magic_write (FILE * fp, mg_u_long magic_num);
     71void magic_check (FILE * fp, mg_u_long magic_num);
     72mg_u_long magic_read (FILE * fp);
    7373/* kerry's code */
    7474
  • main/trunk/greenstone2/common-src/indexers/mg/src/text/Makefile.in

    r22070 r25147  
    3838AR = ar
    3939CC = @CC@
    40 CFLAGS = @CFLAGS@ @COMPAT32BITFLAGS@ -fpic
     40CFLAGS = @CFLAGS@ -fpic
    4141DEFS = @DEFS@
    4242RANLIB = @RANLIB@
     
    4444INSTALL_DATA = @INSTALL_DATA@
    4545INSTALL_PROGRAM = @INSTALL_PROGRAM@
    46 LDFLAGS = @LDFLAGS@ @COMPAT32BITFLAGS@
     46LDFLAGS = @LDFLAGS@
    4747LIBS = ../../lib/libmglib.a @LIBS@
    4848TOUCH = echo timestamp >
     
    5353# Uncomment for compiling for the nzdl project
    5454#
    55 CFLAGS = @CFLAGS@ @COMPAT32BITFLAGS@ -fpic -DNZDL -DQUIET -DSHORT_SUFFIX -DPARADOCNUM
     55CFLAGS = @CFLAGS@ -fpic -DNZDL -DQUIET -DSHORT_SUFFIX -DPARADOCNUM
    5656##########################################
    5757
  • main/trunk/greenstone2/common-src/indexers/mg/src/text/backend.c

    r16583 r25147  
    4747
    4848static File *
    49 OpenFile (char *base, char *suffix, unsigned long magic, int *ok)
     49OpenFile (char *base, char *suffix, mg_u_long magic, int *ok)
    5050{
    5151  char FileName[512];
     
    6262  if (magic)
    6363    {
    64       unsigned long m;
     64      mg_u_long m;
    6565      if (fread ((char *) &m, sizeof (m), 1, F->f) == 0)
    6666    {
     
    475475  if (qd->id->ifh.InvfLevel == 3)
    476476    {
    477       unsigned long magic;
     477      mg_u_long magic;
    478478      FILE *paragraph;
    479479      int i;
     
    507507  {
    508508    extern char *trec_ids;
    509     extern long *trec_paras;
     509    extern mg_s_long *trec_paras;
    510510    int size;
    511511    char FileName[512];
     
    533533      {
    534534    int i, d;
    535     unsigned long magic;
    536     trec_paras = Xmalloc (qd->sd->sdh.num_of_docs * sizeof (long));
     535    mg_u_long magic;
     536    trec_paras = Xmalloc (qd->sd->sdh.num_of_docs * sizeof (mg_s_long));
    537537    if (!trec_paras)
    538538      {
     
    598598 */
    599599void
    600 ChangeMemInUse (query_data * qd, long delta)
     600ChangeMemInUse (query_data * qd, mg_s_long delta)
    601601{
    602602  qd->mem_in_use += delta;
     
    775775}
    776776
    777 long
     777mg_s_long
    778778GetDocCompLength (query_data * qd)
    779779{
     
    785785
    786786u_char *
    787 GetDocText (query_data * qd, unsigned long *len)
     787GetDocText (query_data * qd, mg_u_long *len)
    788788{
    789789  DocEntry *DE;
  • main/trunk/greenstone2/common-src/indexers/mg/src/text/backend.h

    r16583 r25147  
    4040  {
    4141    File *InvfFile;
    42     unsigned long N;
    43     unsigned long Nstatic;  /* N parameter for decoding inverted file entries */
     42    mg_u_long N;
     43    mg_u_long Nstatic;  /* N parameter for decoding inverted file entries */
    4444    struct invf_file_header ifh;
    4545  }
     
    5151    File *TextIdxFile;
    5252    File *TextIdxWgtFile;
    53     long current_pos;
     53    mg_s_long current_pos;
    5454    struct
    5555      {
    56     unsigned long Start;
     56    mg_u_long Start;
    5757    float Weight;
    5858      }
     
    7878    compression_dict_header cdh;
    7979    comp_frags_header *cfh[2];
    80     unsigned long MemForCompDict;
     80    mg_u_long MemForCompDict;
    8181    u_char ***values[2];
    8282    u_char *escape[2];
    8383    huff_data *chars_huff[2];
    84     u_long **chars_vals[2];
     84    mg_u_long **chars_vals[2];
    8585    huff_data *lens_huff[2];
    86     u_long **lens_vals[2];
     86    mg_u_long **lens_vals[2];
    8787    auxiliary_dict *ad;
    8888    int fast_loaded;
     
    9696    struct stem_idx_header sih;
    9797    u_char **index;
    98     unsigned long *pos;
     98    mg_u_long *pos;
    9999    int active;
    100100    u_char *buffer;
    101     unsigned long MemForStemIdx;
     101    mg_u_long MemForStemIdx;
    102102  }
    103103stemmed_idx;
     
    109109    struct stem_dict_header sdh;
    110110    u_char **index;
    111     unsigned long *pos;
     111    mg_u_long *pos;
    112112    int active;
    113113    u_char *buffer;
    114     unsigned long MemForStemDict;
     114    mg_u_long MemForStemDict;
    115115
    116116    /* [RPAP - Jan 97: Stem Index Change] */
     
    126126    double L;
    127127    double B;
    128     unsigned long *DocWeights;
     128    mg_u_long *DocWeights;
    129129    char bits;
    130130    float *table;
    131     unsigned long mask;
    132     unsigned long MemForWeights;
    133     unsigned long num_of_docs;
     131    mg_u_long mask;
     132    mg_u_long MemForWeights;
     133    mg_u_long num_of_docs;
    134134  }
    135135approx_weights_data;
     
    140140    int QueryFreqs;
    141141    int Exact;           /* use exact weights for ranking or not */
    142     long MaxDocsToRetrieve; /* may be -1 for all */
    143     long MaxParasToRetrieve;
     142    mg_s_long MaxDocsToRetrieve;    /* may be -1 for all */
     143    mg_s_long MaxParasToRetrieve;
    144144    int Sort;       
    145145    char AccumMethod;       /* 'A' = array,  'S' = splay tree,  'H' = hash_table */
    146     long MaxAccums;     /* may be -1 for all */
    147     long MaxTerms;      /* may be -1 for all */
     146    mg_s_long MaxAccums;        /* may be -1 for all */
     147    mg_s_long MaxTerms;     /* may be -1 for all */
    148148    int StopAtMaxAccum; /* Stop at maximum accumulator or not */
    149     long HashTblSize;
     149    mg_s_long HashTblSize;
    150150    char *skip_dump;
    151151  }
     
    156156typedef struct BooleanQueryInfo
    157157  {
    158     long MaxDocsToRetrieve;
     158    mg_s_long MaxDocsToRetrieve;
    159159  }
    160160BooleanQueryInfo;
     
    191191    File *File_invf;
    192192    File *File_weight_approx;
    193     unsigned long mem_in_use, max_mem_in_use;
    194     unsigned long num_of_ptrs, tot_num_of_ptrs;
    195     unsigned long num_of_terms, tot_num_of_terms;
    196     unsigned long num_of_accum, tot_num_of_accum;
    197     unsigned long num_of_ans, tot_num_of_ans;
    198     unsigned long hops_taken, tot_hops_taken;
    199     unsigned long text_idx_lookups, tot_text_idx_lookups;
    200     unsigned long max_buffers;
     193    mg_u_long mem_in_use, max_mem_in_use;
     194    mg_u_long num_of_ptrs, tot_num_of_ptrs;
     195    mg_u_long num_of_terms, tot_num_of_terms;
     196    mg_u_long num_of_accum, tot_num_of_accum;
     197    mg_u_long num_of_ans, tot_num_of_ans;
     198    mg_u_long hops_taken, tot_hops_taken;
     199    mg_u_long text_idx_lookups, tot_text_idx_lookups;
     200    mg_u_long max_buffers;
    201201    unsigned doc_pos;
    202202    unsigned buf_in_use;
     
    226226query_data *InitQuerySystem (char *dir, char *name, char *textname, InitQueryTimes * iqt);
    227227
    228 void ChangeMemInUse (query_data * qd, long delta);
     228void ChangeMemInUse (query_data * qd, mg_s_long delta);
    229229
    230230void FinishQuerySystem (query_data * qd);
     
    251251float GetDocWeight (query_data * qd);
    252252
    253 long GetDocCompLength (query_data * qd);
    254 
    255 u_char *GetDocText (query_data * qd, unsigned long *len);
     253mg_s_long GetDocCompLength (query_data * qd);
     254
     255u_char *GetDocText (query_data * qd, mg_u_long *len);
    256256
    257257DocEntry *GetDocChain (query_data * qd);
  • main/trunk/greenstone2/common-src/indexers/mg/src/text/bool_parser.c

    r16583 r25147  
    4444static QueryTermList **query_term_list;
    4545static int word_num;
    46 static u_long count;
    47 static u_long doc_count;
    48 static u_long invf_ptr;
    49 static u_long invf_len;
     46static mg_u_long count;
     47static mg_u_long doc_count;
     48static mg_u_long invf_ptr;
     49static mg_u_long invf_len;
    5050
    5151#line 66 "bool_parser.y"
  • main/trunk/greenstone2/common-src/indexers/mg/src/text/bool_parser.y

    r16583 r25147  
    5757static QueryTermList **query_term_list;
    5858static int word_num;
    59 static u_long count;
    60 static u_long doc_count;
    61 static u_long invf_ptr;
    62 static u_long invf_len;
     59static mg_u_long count;
     60static mg_u_long doc_count;
     61static mg_u_long invf_ptr;
     62static mg_u_long invf_len;
    6363%}
    6464 
  • main/trunk/greenstone2/common-src/indexers/mg/src/text/bool_tester.c

    r16583 r25147  
    151151          prompt (str);
    152152          te->WE.doc_count = atoi (line);
    153           printf ("doc_count = %ld\n", te->WE.doc_count);
     153          printf ("doc_count = %d\n", te->WE.doc_count);
    154154        }           /*for */
    155155    }           /*if */
  • main/trunk/greenstone2/common-src/indexers/mg/src/text/bool_tree.c

    r16583 r25147  
    5656bool_tree_node *
    5757CreateBoolTermNode (TermList ** tl, char *text, int Count, int word_num,
    58             u_long count, u_long doc_count, u_long invf_ptr, u_long invf_len,  /* [RPAP - Feb 97: Term Frequency] */
     58            mg_u_long count, mg_u_long doc_count, mg_u_long invf_ptr, mg_u_long invf_len,  /* [RPAP - Feb 97: Term Frequency] */
    5959            int stemmer_num)
    6060{
  • main/trunk/greenstone2/common-src/indexers/mg/src/text/bool_tree.h

    r16583 r25147  
    102102bool_tree_node *CopyBoolTree (bool_tree_node * tree);
    103103bool_tree_node *CreateBoolTermNode (TermList ** tl, char *text, int Count, int word_num,
    104                     u_long count, u_long doc_count, u_long invf_ptr,
    105                     u_long invf_len, int stemmer_num);
     104                    mg_u_long count, mg_u_long doc_count, mg_u_long invf_ptr,
     105                    mg_u_long invf_len, int stemmer_num);
    106106bool_tree_node *CreateBoolTreeNode (N_Tag tag,
    107107                 bool_tree_node * left, bool_tree_node * right);
  • main/trunk/greenstone2/common-src/indexers/mg/src/text/build.h

    r16583 r25147  
    111111
    112112
    113 extern unsigned long buf_size;
     113extern mg_u_long buf_size;
    114114/*
    115115 * The size of the document input buffer.
    116116 */
    117117
    118 extern unsigned long ChunkLimit;
     118extern mg_u_long ChunkLimit;
    119119/*
    120120 * The maximum number of chunks that can be written to disk.
    121121 */
    122122
    123 extern unsigned long invf_buffer_size;
     123extern mg_u_long invf_buffer_size;
    124124/*
    125125 * The amount of memory to allocate to the invertion buffer.
  • main/trunk/greenstone2/common-src/indexers/mg/src/text/comp_dict.c

    r16583 r25147  
    6666huff_data char_huff[2];
    6767huff_data lens_huff[2];
    68 u_long *char_codes[2], *lens_codes[2];
    69 u_long Words_disk = 0;
    70 u_long Chars_disk = 0;
     68mg_u_long *char_codes[2], *lens_codes[2];
     69mg_u_long Words_disk = 0;
     70mg_u_long Chars_disk = 0;
    7171
    7272
     
    7979  dict_hash_table *ht;
    8080  u_char **words;
    81   u_long ht_size;
     81  mg_u_long ht_size;
    8282
    8383  ht_size = prime (cfh->hd.num_codes * HASH_RATIO);
     
    133133      register u_char **wptr;
    134134      register int tsize = ht->size;
    135       register unsigned long hashval, step;
     135      register mg_u_long hashval, step;
    136136
    137137      HASH (hashval, step, allwords, tsize);
     
    163163    return COMPERROR;
    164164
    165   Words_disk = sizeof (u_long);
     165  Words_disk = sizeof (mg_u_long);
    166166
    167167  if (Read_cdh (dict, &cdh, NULL, &Words_disk) == -1)
  • main/trunk/greenstone2/common-src/indexers/mg/src/text/comp_dict.h

    r16583 r25147  
    3232typedef struct dict_hash_table
    3333  {
    34     u_long size;
     34    mg_u_long size;
    3535    huff_data *hd;
    36     u_long *codes;
     36    mg_u_long *codes;
    3737    u_char **words;
    3838    u_char **table[1];
     
    5151extern huff_data char_huff[2];
    5252extern huff_data lens_huff[2];
    53 extern u_long *char_codes[2], *lens_codes[2];
    54 extern u_long Words_disk;
    55 extern u_long Chars_disk;
     53extern mg_u_long *char_codes[2], *lens_codes[2];
     54extern mg_u_long Words_disk;
     55extern mg_u_long Chars_disk;
    5656
    5757
  • main/trunk/greenstone2/common-src/indexers/mg/src/text/environment.c

    r16583 r25147  
    347347 * or default on a error
    348348 */
    349 long
    350 IntEnv (char *data, long def)
    351 {
    352   long val;
     349mg_s_long
     350IntEnv (char *data, mg_s_long def)
     351{
     352  mg_s_long val;
    353353  char *ptr;
    354354  if (!data)
  • main/trunk/greenstone2/common-src/indexers/mg/src/text/environment.h

    r16583 r25147  
    5454char *GetEnvName (int i);
    5555int BooleanEnv (char *data, int def);
    56 long IntEnv (char *data, long def);
     56mg_s_long IntEnv (char *data, mg_s_long def);
    5757
    5858void InitEnv (void);
  • main/trunk/greenstone2/common-src/indexers/mg/src/text/hash.h

    r16583 r25147  
    3131    do {                        \
    3232        register u_char *p=wd;          \
    33         register long len = *p++;       \
    34         register unsigned long hval;        \
     33        register mg_s_long len = *p++;      \
     34        register mg_u_long hval;        \
    3535        if (len>25) len = 25;           \
    3636        for (hval=0; len; --len)        \
  • main/trunk/greenstone2/common-src/indexers/mg/src/text/invf.h

    r16583 r25147  
    3030struct invf_dict_header
    3131  {
    32     unsigned long lookback;
    33     unsigned long dict_size;
    34     unsigned long total_bytes;
    35     unsigned long index_string_bytes;
     32    mg_u_long lookback;
     33    mg_u_long dict_size;
     34    mg_u_long total_bytes;
     35    mg_u_long index_string_bytes;
    3636    double input_bytes; /* [RJM 07/97: 4G limit] */
    37     unsigned long num_of_docs;
    38     unsigned long static_num_of_docs;
    39     unsigned long num_of_words;
    40     unsigned long stemmer_num;
    41     unsigned long stem_method;
     37    mg_u_long num_of_docs;
     38    mg_u_long static_num_of_docs;
     39    mg_u_long num_of_words;
     40    mg_u_long stemmer_num;
     41    mg_u_long stem_method;
    4242  };
    4343
    4444struct stem_dict_header
    4545  {
    46     unsigned long lookback;
    47     unsigned long block_size;
    48     unsigned long num_blocks;
    49     unsigned long blocks_start;
    50     unsigned long index_chars;
    51     unsigned long num_of_docs;
    52     unsigned long static_num_of_docs;
    53     unsigned long num_of_words;
    54     unsigned long stemmer_num;
    55     unsigned long stem_method;
    56     unsigned long indexed;       /* [RPAP - Jan 97: Stem Index Change] */
     46    mg_u_long lookback;
     47    mg_u_long block_size;
     48    mg_u_long num_blocks;
     49    mg_u_long blocks_start;
     50    mg_u_long index_chars;
     51    mg_u_long num_of_docs;
     52    mg_u_long static_num_of_docs;
     53    mg_u_long num_of_words;
     54    mg_u_long stemmer_num;
     55    mg_u_long stem_method;
     56    mg_u_long indexed;       /* [RPAP - Jan 97: Stem Index Change] */
    5757  };
    5858
    5959struct invf_file_header
    6060  {
    61     unsigned long no_of_words;
    62     unsigned long no_of_ptrs;
    63     unsigned long skip_mode;
    64     unsigned long params[16];
    65     unsigned long InvfLevel;
     61    mg_u_long no_of_words;
     62    mg_u_long no_of_ptrs;
     63    mg_u_long skip_mode;
     64    mg_u_long params[16];
     65    mg_u_long InvfLevel;
    6666  };
    6767
     
    6969struct stem_idx_header
    7070  {
    71     unsigned long lookback;
    72     unsigned long block_size;
    73     unsigned long num_blocks;
    74     unsigned long blocks_start;
    75     unsigned long index_chars;
    76     unsigned long num_of_words;
     71    mg_u_long lookback;
     72    mg_u_long block_size;
     73    mg_u_long num_blocks;
     74    mg_u_long blocks_start;
     75    mg_u_long index_chars;
     76    mg_u_long num_of_words;
    7777  };
    7878
  • main/trunk/greenstone2/common-src/indexers/mg/src/text/invf_get.c

    r16583 r25147  
    166166
    167167static void
    168 HT_Sup_Add (Hash_Table * HT, unsigned long DN, float Sum)
     168HT_Sup_Add (Hash_Table * HT, mg_u_long DN, float Sum)
    169169{
    170170  Invf_Doc_EntryH *IDEH;
     
    176176
    177177Invf_Doc_Entry *
    178 HT_find (Hash_Table * HT, unsigned long DN)
     178HT_find (Hash_Table * HT, mg_u_long DN)
    179179{
    180180  Invf_Doc_EntryH *IDEH;
     
    194194static int
    195195HT_insert (Hash_Table * HT,
    196        unsigned long DN, float Sum)
     196       mg_u_long DN, float Sum)
    197197{
    198198  Invf_Doc_EntryH **IDEH;
     
    316316
    317317Invf_Doc_Entry *
    318 LT_find (List_Table * LT, unsigned long DN)
     318LT_find (List_Table * LT, mg_u_long DN)
    319319{
    320320  int l = 0;
     
    337337static List_Table *
    338338LT_add (query_data * qd, List_Table * LT,
    339     unsigned long DN, float Sum)
     339    mg_u_long DN, float Sum)
    340340{
    341341  Invf_Doc_Entry *ide;
     
    472472    case 1:
    473473      {
    474     unsigned long len;
     474    mg_u_long len;
    475475    if (*p <= qd->id->ifh.params[0])
    476476      *k = 0;
     
    488488    case 2:
    489489      {
    490     unsigned long len;
     490    mg_u_long len;
    491491    if (*p <= qd->id->ifh.params[1])
    492492      *k = 0;
     
    533533  DocEntry *src = NULL, *dest = NULL;
    534534  int i;            /* index counter into inverted list */
    535   unsigned long pos;
     535  mg_u_long pos;
    536536  int next_start, next_doc_num, next_i;
    537537  int block_counter;        /* within counter in block */
     
    540540  int blk;          /* bblock control parameter */
    541541  int ft;           /* The number of documents the word occurs in */
    542   unsigned long CurrDoc = 0;    /* NOTE: Document numbers start at 1 */
     542  mg_u_long CurrDoc = 0;    /* NOTE: Document numbers start at 1 */
    543543  float Weight;
    544544
     
    582582  while (i < ft && ((op == op_term) || src - L->DE < L->num))
    583583    {
    584       unsigned long diff, Temp;
     584      mg_u_long diff, Temp;
    585585
    586586      if (have_skipping)
     
    754754      u_char *buffer;
    755755      int i, kd;
    756       unsigned long next_mjr_dn = 0;
    757       unsigned long CurrDocNum = 0; /* NOTE: Document numbers start at 1 */
    758       unsigned long LastDocNum = 0; /* [RJM 07/97: Ranked Required Terms] */
    759       unsigned long TempDocNum = 0; /* [RJM 07/97: Ranked Required Terms] */
     756      mg_u_long next_mjr_dn = 0;
     757      mg_u_long CurrDocNum = 0; /* NOTE: Document numbers start at 1 */
     758      mg_u_long LastDocNum = 0; /* [RJM 07/97: Ranked Required Terms] */
     759      mg_u_long TempDocNum = 0; /* [RJM 07/97: Ranked Required Terms] */
    760760      double Wqt, WordLog;
    761761      int dn_blk = 0, len_blk = 0, k;
     
    787787      int Count;        /* The number of times the word occurs in a document */
    788788      double Wdt;
    789       unsigned long diff;
     789      mg_u_long diff;
    790790      if (kd == k)
    791791        {
     
    919919      skip_header = 1;
    920920      fprintf (sk, "%s", skip_header_text[qd->id->ifh.skip_mode]);
    921       fprintf (sk, "\nSkipping method %ld\n", qd->id->ifh.skip_mode);
     921      fprintf (sk, "\nSkipping method %d\n", qd->id->ifh.skip_mode);
    922922      switch (qd->id->ifh.skip_mode)
    923923        {
    924924        case 1:
    925           fprintf (sk, "Skipping is every %ld docnums\n",
     925          fprintf (sk, "Skipping is every %d docnums\n",
    926926               qd->id->ifh.params[0]);
    927927          break;
    928928        case 2:
    929           fprintf (sk, "Max nodes = %ld\nNo skips smaller or equal to %ld\n",
     929          fprintf (sk, "Max nodes = %d\nNo skips smaller or equal to %d\n",
    930930               qd->id->ifh.params[0], qd->id->ifh.params[1]);
    931931          break;
     
    958958      u_char *buffer;
    959959      int pos, i;
    960       unsigned long CurrDocNum = 0; /* NOTE: Document numbers start at 1 */
     960      mg_u_long CurrDocNum = 0; /* NOTE: Document numbers start at 1 */
    961961      double Wqt, WordLog;
    962962      int dn_blk = 0, len_blk = 0, k, kd;
     
    971971      if (sk)
    972972    {
    973       fprintf (sk, "%3d : %8ld %6ld \"%.*s\"%*s", j, we->count,
     973      fprintf (sk, "%3d : %8d %6d \"%.*s\"%*s", j, we->count,
    974974         we->doc_count, Terms->TE[j].Word[0], Terms->TE[j].Word + 1,
    975975           indent - Terms->TE[j].Word[0], "");
     
    10101010      int Count;        /* The number of times the occurs in a document */
    10111011      double Wdt;
    1012       unsigned long diff;
     1012      mg_u_long diff;
    10131013      Invf_Doc_Entry ent, *mem;
    10141014      if (k)
     
    10261026        }
    10271027          if (kd == k - 1)
     1028        {
    10281029        if (i + k < p)
    10291030          {
     
    10361037          }
    10371038        else
     1039          {
    10381040          next_doc_num = -1;
     1041          }
     1042        }
    10391043          if (Anding && i + k < p && next->DocNum > next_doc_num &&
    10401044          next_doc_num >= 0)
     
    11491153      skip_header = 1;
    11501154      fprintf (sk, "%s", skip_header_text[qd->id->ifh.skip_mode]);
    1151       fprintf (sk, "\nSkipping method %ld\n", qd->id->ifh.skip_mode);
     1155      fprintf (sk, "\nSkipping method %d\n", qd->id->ifh.skip_mode);
    11521156      switch (qd->id->ifh.skip_mode)
    11531157        {
    11541158        case 1:
    1155           fprintf (sk, "Skipping is every %ld docnums\n",
     1159          fprintf (sk, "Skipping is every %d docnums\n",
    11561160               qd->id->ifh.params[0]);
    11571161          break;
    11581162        case 2:
    1159           fprintf (sk, "Max nodes = %ld\nNo skips smaller or equal to %ld\n",
     1163          fprintf (sk, "Max nodes = %d\nNo skips smaller or equal to %d\n",
    11601164               qd->id->ifh.params[0], qd->id->ifh.params[1]);
    11611165          break;
     
    11881192      int pos;
    11891193      int i;
    1190       unsigned long CurrDocNum = 0; /* NOTE: Document numbers start at 1 */
     1194      mg_u_long CurrDocNum = 0; /* NOTE: Document numbers start at 1 */
    11911195      double Wqt, WordLog;
    11921196      int dn_blk = 0, len_blk = 0, k, kd;
     
    12011205      if (sk)
    12021206    {
    1203       fprintf (sk, "%3d : %8ld %6ld \"%.*s\"%*s", j, we->count,
     1207      fprintf (sk, "%3d : %8d %6d \"%.*s\"%*s", j, we->count,
    12041208         we->doc_count, Terms->TE[j].Word[0], Terms->TE[j].Word + 1,
    12051209           indent - Terms->TE[j].Word[0], "");
     
    12451249      int Count;        /* The number of times the occurs in a document */
    12461250      double Wdt;
    1247       unsigned long diff;
     1251      mg_u_long diff;
    12481252      Invf_Doc_Entry *mem;
    12491253      if (k)
     
    13911395      skip_header = 1;
    13921396      fprintf (sk, "%s", skip_header_text[qd->id->ifh.skip_mode]);
    1393       fprintf (sk, "\nSkipping method %ld\n", qd->id->ifh.skip_mode);
     1397      fprintf (sk, "\nSkipping method %d\n", qd->id->ifh.skip_mode);
    13941398      switch (qd->id->ifh.skip_mode)
    13951399        {
    13961400        case 1:
    1397           fprintf (sk, "Skipping is every %ld docnums\n",
     1401          fprintf (sk, "Skipping is every %d docnums\n",
    13981402               qd->id->ifh.params[0]);
    13991403          break;
    14001404        case 2:
    1401           fprintf (sk, "Max nodes = %ld\nNo skips smaller or equal to %ld\n",
     1405          fprintf (sk, "Max nodes = %d\nNo skips smaller or equal to %d\n",
    14021406               qd->id->ifh.params[0], qd->id->ifh.params[1]);
    14031407          break;
     
    14311435      int pos;
    14321436      int i, n = 0;
    1433       unsigned long CurrDocNum = 0; /* NOTE: Document numbers start at 1 */
    1434       unsigned long LastDocNum = 0; /* [RJM 07/97: Ranked Required Match] */
     1437      mg_u_long CurrDocNum = 0; /* NOTE: Document numbers start at 1 */
     1438      mg_u_long LastDocNum = 0; /* [RJM 07/97: Ranked Required Match] */
    14351439      int this_item = 0; /* [RJM 07/97: Ranked Required Match] points to the next possible LT to delete */
    14361440      double Wqt, WordLog;
     
    14481452      if (sk)
    14491453    {
    1450       fprintf (sk, "%3d : %8ld %6ld \"%.*s\"%*s", j, we->count,
     1454      fprintf (sk, "%3d : %8d %6d \"%.*s\"%*s", j, we->count,
    14511455         we->doc_count, Terms->TE[j].Word[0], Terms->TE[j].Word + 1,
    14521456           indent - Terms->TE[j].Word[0], "");
     
    15111515      int Count;        /* The number of times the occurs in a document */
    15121516      double Wdt;
    1513       unsigned long diff;
     1517      mg_u_long diff;
    15141518      Invf_Doc_Entry *mem;
    15151519
     
    15301534        }
    15311535          if (kd == k - 1)
     1536        {
    15321537        if (i + k < p)
    15331538          {
     
    15401545          }
    15411546        else
     1547          {
    15421548          next_doc_num = -1;
    1543 
     1549          }
     1550        }
    15441551          /* should we take another skip? */
    15451552          if (Anding && i + k < p && next->DocNum > next_doc_num &&
  • main/trunk/greenstone2/common-src/indexers/mg/src/text/invf_get.h

    r16583 r25147  
    7575Op_types;
    7676
    77 /*Invf_Doc_Entry *HT_find(Hash_Table *HT, unsigned long DN); */
     77/*Invf_Doc_Entry *HT_find(Hash_Table *HT, mg_u_long DN); */
    7878void HT_free (query_data * qd, Hash_Table * HT);
    7979void LT_free (query_data * qd, List_Table * LT);
  • main/trunk/greenstone2/common-src/indexers/mg/src/text/ivf.pass1.c

    r16583 r25147  
    117117typedef struct hash_rec
    118118  {
    119     unsigned long fcnt;     /* fragment frequency */
    120     unsigned long lfcnt;    /* local fragment frequency */
    121     unsigned long fnum;     /* last fragment to use stem */
    122     unsigned long wcnt;     /* stem frequency */
    123     unsigned long lwcnt;    /* local stem frequency */
     119    mg_u_long fcnt;     /* fragment frequency */
     120    mg_u_long lfcnt;    /* local fragment frequency */
     121    mg_u_long fnum;     /* last fragment to use stem */
     122    mg_u_long wcnt;     /* stem frequency */
     123    mg_u_long lwcnt;    /* local stem frequency */
    124124    u_char *word;
    125125  }
    126126hash_rec;
    127127
    128 static unsigned long words_read = 0, words_diff = 0, bytes_diff = 0;
    129 static unsigned long outputbytes = 0;
    130 static unsigned long inputbytes = 0;
    131 static unsigned long MaxMemInUse = 0;
    132 static unsigned long MemInUse = 0;
    133 static unsigned long ChunksWritten = 0;
     128static mg_u_long words_read = 0, words_diff = 0, bytes_diff = 0;
     129static mg_u_long outputbytes = 0;
     130static mg_u_long inputbytes = 0;
     131static mg_u_long MaxMemInUse = 0;
     132static mg_u_long MemInUse = 0;
     133static mg_u_long ChunksWritten = 0;
    134134
    135135
     
    138138
    139139static hash_rec **HashTable;
    140 static unsigned long HashSize=0;
    141 static unsigned long HashUsed=0;
     140static mg_u_long HashSize=0;
     141static mg_u_long HashUsed=0;
    142142static u_char *Pool;
    143143static int PoolLeft=0;
     
    152152static mg_ullong L2_bits = 0;
    153153static mg_ullong L3_bits = 0;
    154 static unsigned long L1_ohead = 0;
    155 static unsigned long L2_ohead = 0;
    156 static unsigned long L3_ohead = 0;
    157 static unsigned long callnum = 0, lcallnum = 0, wordnum = 0, lwordnum = 0;
    158 static unsigned long ptrcnt = 0;
    159 static unsigned long checknum=0;
    160 static long max_mem = 0;
     154static mg_u_long L1_ohead = 0;
     155static mg_u_long L2_ohead = 0;
     156static mg_u_long L3_ohead = 0;
     157static mg_u_long callnum = 0, lcallnum = 0, wordnum = 0, lwordnum = 0;
     158static mg_u_long ptrcnt = 0;
     159static mg_u_long checknum=0;
     160static mg_s_long max_mem = 0;
    161161
    162162
     
    211211              MG_MESSAGE)))  /* [RPAP - Feb 97: WIN32 Port] */
    212212    return (COMPERROR);
    213   fwrite ("    ", sizeof (u_long), 1, ic);  /* Space for the maxmem */
     213  fwrite ("    ", sizeof (mg_u_long), 1, ic);   /* Space for the maxmem */
    214214  ENCODE_START (ic)
    215215    ENCODE_PAUSE (sbs)
     
    256256
    257257
    258 static unsigned long
     258static mg_u_long
    259259mem_reqd (void)
    260260{
    261261  register int i;
    262   register unsigned long total = 0;
    263 /*  register unsigned long N = InvfLevel == 3 ? lwordnum : lcallnum; */
    264   register unsigned long N = lcallnum;
     262  register mg_u_long total = 0;
     263/*  register mg_u_long N = InvfLevel == 3 ? lwordnum : lcallnum; */
     264  register mg_u_long N = lcallnum;
    265265  for (i = 0; i < HashUsed; i++)
    266266    {
    267267      register hash_rec *ent = first_occr[i];
    268 /*      register unsigned long p = InvfLevel == 3 ? ent->lwcnt : ent->lfcnt; */
    269       register unsigned long p = ent->lfcnt;
     268/*      register mg_u_long p = InvfLevel == 3 ? ent->lwcnt : ent->lfcnt; */
     269      register mg_u_long p = ent->lfcnt;
    270270      if (p)
    271271    total += BIO_Bblock_Bound (N, p);
     
    278278}
    279279
    280 static unsigned long
     280static mg_u_long
    281281max_mem_reqd (void)
    282282{
    283283  register int i;
    284   register unsigned long total = 0;
    285 /*  register unsigned long N = InvfLevel == 3 ? wordnum : callnum; */
    286   register unsigned long N = callnum;
     284  register mg_u_long total = 0;
     285/*  register mg_u_long N = InvfLevel == 3 ? wordnum : callnum; */
     286  register mg_u_long N = callnum;
    287287  for (i = 0; i < HashUsed; i++)
    288288    {
    289289      register hash_rec *ent = first_occr[i];
    290 /*      register unsigned long p = InvfLevel == 3 ? ent->wcnt : ent->fcnt; */
    291       register unsigned long p = ent->fcnt;
     290/*      register mg_u_long p = InvfLevel == 3 ? ent->wcnt : ent->fcnt; */
     291      register mg_u_long p = ent->fcnt;
    292292      if (p)
    293293    total += BIO_Bblock_Bound (N, p);
     
    302302
    303303static void
    304 dump_dict (unsigned long mem)
     304dump_dict (mg_u_long mem)
    305305{
    306306  int i;
     
    367367      /* Search the hash table for Word */
    368368      {
    369     register unsigned long hashval, step;
     369    register mg_u_long hashval, step;
    370370    register int hsize = HashSize;
    371371    HASH (hashval, step, Word, hsize);
     
    464464    {
    465465      hash_rec **ht;
    466       unsigned long size;
    467       unsigned long i;
     466      mg_u_long size;
     467      mg_u_long i;
    468468      size = prime (HashSize * 2);
    469469      if (!(ht = Xmalloc (sizeof (hash_rec *) * size)))
     
    480480        register u_char *wptr;
    481481        hash_rec *ent;
    482         register unsigned long hashval, step;
     482        register mg_u_long hashval, step;
    483483
    484484        wptr = HashTable[i]->word;
     
    504504  if (ptrcnt >= checknum)
    505505    {
    506       unsigned long mem;
     506      mg_u_long mem;
    507507      /*fprintf(stderr, "Checking at %u . . . ", ptrcnt); */
    508508      mem = mem_reqd ();
     
    617617      /* check for overflow */
    618618      if (L1_bits + L2_bits < oldL12_bits) {
    619     fprintf(stderr, "ERROR: Inverted file size will probably overflow %d byte unsigned integer\n", sizeof (mg_ullong));
     619    fprintf(stderr, "ERROR: Inverted file size will probably overflow %lu byte unsigned integer\n", sizeof (mg_ullong));
    620620    fprintf(stderr, "       counter in pass 2.\n");
    621621    if (sizeof (mg_ullong) < 8) {
     
    659659write_stem_file (char *file_name)
    660660{
    661   long j;
     661  mg_s_long j;
    662662  struct invf_dict_header idh;
    663   long lookback = (1 << LOGLOOKBACK);   /* ???? */
    664   long totalbytes = 0;      /* The sum of the length of all words, including
     663  mg_s_long lookback = (1 << LOGLOOKBACK);  /* ???? */
     664  mg_s_long totalbytes = 0;     /* The sum of the length of all words, including
    665665                   the length byte */
    666   long indexstringbytes = 0;    /* The amount of space required to store the
     666  mg_s_long indexstringbytes = 0;   /* The amount of space required to store the
    667667                   words in the diction, this takes into account
    668668                   the prefixes */
     
    706706    {
    707707      int i;
    708       unsigned long wcnt, fcnt;  /* [RPAP - Jan 97: Endian Ordering] */
     708      mg_u_long wcnt, fcnt;  /* [RPAP - Jan 97: Endian Ordering] */
    709709      hash_rec *ent = HashTable[j];
    710710      if (lastword != NULL)
     
    750750write_codes (char *file_name)
    751751{
    752   unsigned long dicts = 0;
     752  mg_u_long dicts = 0;
    753753  outputbytes = 0;
    754754  write_stem_file (file_name);
     
    805805    {
    806806      /* [RPAP - Jan 97: Endian Ordering] */
    807       unsigned long fnum;
     807      mg_u_long fnum;
    808808      HTONUL2(first_occur[i]->fnum, fnum);
    809       fwrite ((char *) &fnum, sizeof (unsigned long), 1, f);
     809      fwrite ((char *) &fnum, sizeof (mg_u_long), 1, f);
    810810    }
    811811#endif
     
    837837    GAMMA_ENCODE (1);
    838838  ENCODE_DONE
    839     fseek (ic, sizeof (long), 0);
     839    fseek (ic, sizeof (mg_s_long), 0);
    840840 
    841841  HTONSL(max_mem);  /* [RPAP - Jan 97: Endian Ordering] */
  • main/trunk/greenstone2/common-src/indexers/mg/src/text/ivf.pass2.c

    r16583 r25147  
    3939 * Revision 1.2  1997/08/02  05:01:57  wew
    4040 * changed literal values of 32 for the bit size of magic numbers of
    41  * files to sizeof (unsigned long) * 8, increased the gap at the start
     41 * files to sizeof (mg_u_long) * 8, increased the gap at the start
    4242 * of the invf during processing to 200 bytes
    4343
     
    127127    struct stat file_state;\
    128128    fstat(fileno(invf_out), &file_state);\
    129     Message("len(invf) = %ld", file_state.st_size);\
     129    Message("len(invf) = %d", file_state.st_size);\
    130130  }while(0)
    131131
    132132typedef struct word_rec
    133133  {
    134     unsigned long ptr;
    135     unsigned long last;
     134    mg_u_long ptr;
     135    mg_u_long last;
    136136  }
    137137word_rec;
     
    141141    mg_ullong Disk_Ptr;
    142142    mg_ullong Disk_Last;
    143     unsigned long Disk_B;
     143    mg_u_long Disk_B;
    144144  }
    145145invf_state_rec;
     
    147147typedef struct chunk
    148148  {
    149     unsigned long start_doc;
    150     unsigned long params_pos;
    151     unsigned long disk_pos;
    152     unsigned long N;
     149    mg_u_long start_doc;
     150    mg_u_long params_pos;
     151    mg_u_long disk_pos;
     152    mg_u_long N;
    153153  }
    154154chunk;
     
    175175
    176176static int docs_left = 0, next_docs_left = 0;
    177 static unsigned long N;
     177static mg_u_long N;
    178178
    179179static word_rec *WordRecs;
     
    182182
    183183static char *MemoryBuffer = NULL;
    184 static unsigned long MemBufSize;
    185 static unsigned long BufToUse;
     184static mg_u_long MemBufSize;
     185static mg_u_long BufToUse;
    186186static struct invf_dict_header idh;
    187187
    188188static perf_hash_data *phd;
    189189
    190 static unsigned long *word_list = NULL;
    191 static unsigned long wl_size = 0;
    192 
    193 static unsigned long dict_size;
    194 static unsigned long no_of_ptrs = 0;
    195 static unsigned long chunks_read = 0;
    196 static unsigned long Disk_pos = 0;
    197 static unsigned long callnum = 0;
    198 static unsigned long wordnum = 0;
    199 
    200 static unsigned long totalIbytes = 0;
    201 static unsigned long totalDbytes = 0;
    202 static unsigned long totalHbytes = 0;
    203 
    204 static unsigned long MemInUse = 0;
    205 static unsigned long MaxMemInUse = 0;
    206 static unsigned long max_buffer_len;
     190static mg_u_long *word_list = NULL;
     191static mg_u_long wl_size = 0;
     192
     193static mg_u_long dict_size;
     194static mg_u_long no_of_ptrs = 0;
     195static mg_u_long chunks_read = 0;
     196static mg_u_long Disk_pos = 0;
     197static mg_u_long callnum = 0;
     198static mg_u_long wordnum = 0;
     199
     200static mg_u_long totalIbytes = 0;
     201static mg_u_long totalDbytes = 0;
     202static mg_u_long totalHbytes = 0;
     203
     204static mg_u_long MemInUse = 0;
     205static mg_u_long MaxMemInUse = 0;
     206static mg_u_long max_buffer_len;
    207207
    208208void
     
    292292      return (COMPERROR);
    293293
    294   sprintf (FName, FILE_NAME_FORMAT ".%ld", get_basepath (), file_name,
    295        ".invf.state", (long) getpid ());  /* [RPAP - Feb 97: WIN32 Port] */
     294  sprintf (FName, FILE_NAME_FORMAT ".%d", get_basepath (), file_name,
     295       ".invf.state", (mg_s_long) getpid ());  /* [RPAP - Feb 97: WIN32 Port] */
    296296  if (!(invf_state = fopen (FName, "w+b")))  /* [RPAP - Feb 97: WIN32 Port] */
    297297    {
     
    301301  unlink (FName);
    302302
    303   sprintf (FName, FILE_NAME_FORMAT ".%ld", get_basepath (), file_name,
    304        ".chunk.state", (long) getpid ());  /* [RPAP - Feb 97: WIN32 Port] */
     303  sprintf (FName, FILE_NAME_FORMAT ".%d", get_basepath (), file_name,
     304       ".chunk.state", (mg_s_long) getpid ());  /* [RPAP - Feb 97: WIN32 Port] */
    305305  if (!(chunk_state = fopen (FName, "w+b")))  /* [RPAP - Feb 97: WIN32 Port] */
    306306    {
     
    312312  ChangeMemInUse (RND_BUF_SIZE);
    313313
    314   sprintf (FName, FILE_NAME_FORMAT ".%ld", get_basepath (), file_name,
    315        ".chunks", (long) getpid ());  /* [RPAP - Feb 97: WIN32 Port] */
     314  sprintf (FName, FILE_NAME_FORMAT ".%d", get_basepath (), file_name,
     315       ".chunks", (mg_s_long) getpid ());  /* [RPAP - Feb 97: WIN32 Port] */
    316316  if (!(chunks = fopen (FName, "w+b")))  /* [RPAP - Feb 97: WIN32 Port] */
    317317    {
     
    329329
    330330#define ISR_CACHE 1024
    331 #define ISR_ENTRY_SIZE (sizeof(mg_ullong)*2 + sizeof(unsigned long))
     331#define ISR_ENTRY_SIZE (sizeof(mg_ullong)*2 + sizeof(mg_u_long))
    332332
    333333invf_state_rec *
     
    360360
    361361
    362 unsigned long
    363 occur_to_lexical (long occ, int clear_state)
    364 {
    365   static long pos = -1;
     362mg_u_long
     363occur_to_lexical (mg_s_long occ, int clear_state)
     364{
     365  static mg_s_long pos = -1;
    366366  static random_bitio_state rbs;
    367367  static int val = 0;
     
    383383      return 0;
    384384    }
    385       BIO_Random_Seek_X (sizeof (unsigned long) * 8, &rbs);
     385      BIO_Random_Seek_X (sizeof (mg_u_long) * 8, &rbs);
    386386      pos = 0;
    387387    }
     
    396396
    397397void
    398 add_chunk_state (unsigned long pos, unsigned long start_doc,
    399          unsigned long N)
     398add_chunk_state (mg_u_long pos, mg_u_long start_doc,
     399         mg_u_long N)
    400400{
    401401  chunk_data[chunks_read].params_pos = pos;
     
    448448  totalHbytes = sizeof (perf_hash_data) + sizeof (u_char) * 256 +
    449449    sizeof (int) * (phd->MAX_N + 1) + sizeof (int *) * 3 * phd->MAX_CH +
    450     sizeof (long) * phd->MAX_CH * phd->MAX_L;
     450    sizeof (mg_s_long) * phd->MAX_CH * phd->MAX_L;
    451451
    452452  if (!(WordRecs = Xmalloc (sizeof (word_rec) * idh.dict_size)))
     
    488488  totalDbytes += sizeof (chunk) * (ChunkLimit + 2);
    489489
    490   totalIbits = sizeof (unsigned long) * 8;      /* The magic number */
     490  totalIbits = sizeof (mg_u_long) * 8;      /* The magic number */
    491491  totalIbits += 8 * 200;    /* A 200 byte gap */
    492492
     
    506506    {
    507507      invf_state_rec *isr;
    508       register unsigned long copy, suff, p;
    509       unsigned long fcnt, wcnt;
     508      register mg_u_long copy, suff, p;
     509      mg_u_long fcnt, wcnt;
    510510
    511511      lasttotalIbits = totalIbits;
     
    551551
    552552      if (totalIbits < lasttotalIbits) {
    553     fprintf(stderr, "ERROR: The totalIbits counter (%d byte unsigned integer) has overflowed.\n", sizeof (mg_ullong));
     553    fprintf(stderr, "ERROR: The totalIbits counter (%lu byte unsigned integer) has overflowed.\n", sizeof (mg_ullong));
    554554    if (sizeof (mg_ullong) < 8) {
    555555      fprintf(stderr, "       Try compiling with GCC to enable use of 8 bytes for this counter.\n");
     
    578578LoadCounts (void)
    579579{
    580   unsigned long numwords, i, last_total;
    581   static unsigned long local_N = 0;
    582   unsigned long totalIbits, crbs_pos;
     580  mg_u_long numwords, i, last_total;
     581  static mg_u_long local_N = 0;
     582  mg_u_long totalIbits, crbs_pos;
    583583  word_rec *wr;
    584   unsigned long *counts;
     584  mg_u_long *counts;
    585585
    586586  if (MemoryBuffer == NULL)
    587587    {
    588       MemBufSize = sizeof (unsigned long) * dict_size;
     588      MemBufSize = sizeof (mg_u_long) * dict_size;
    589589      if (max_buffer_len > MemBufSize)
    590590    MemBufSize = max_buffer_len;
     
    593593      ChangeMemInUse (MemBufSize);
    594594    }
    595   counts = (unsigned long *) MemoryBuffer;
    596 /*   bzero ((char *) counts, sizeof (unsigned long) * dict_size); */
     595  counts = (mg_u_long *) MemoryBuffer;
     596/*   bzero ((char *) counts, sizeof (mg_u_long) * dict_size); */
    597597  bzero ((char *) counts, MemBufSize);
    598598  docs_left = next_docs_left;
     
    613613  for (i = 0; i < numwords; i++)
    614614    {
    615       unsigned long word_num, wcnt, fcnt, p;
     615      mg_u_long word_num, wcnt, fcnt, p;
    616616      word_num = occur_to_lexical (i,0);
    617617     
     
    628628      if (wcnt)
    629629    {
    630       register unsigned long length;
     630      register mg_u_long length;
    631631      counts[word_num] = p;
    632632      length = BIO_Bblock_Bound (local_N, p);
     
    644644  for (wr = WordRecs, i = 0; i < dict_size; i++, wr++)
    645645    {
    646       register unsigned long length;
     646      register mg_u_long length;
    647647      length = wr->ptr;
    648648      wr->last = callnum;
     
    688688  random_bitio_state *rbsi;
    689689  random_bitio_state *chks = NULL;
    690   unsigned long *chunk_ptrs;
     690  mg_u_long *chunk_ptrs;
    691691  int i;
    692692
    693693  BIO_Random_Flush (&crbs);
    694694
    695   chunk_ptrs = Xmalloc (chunks_read * sizeof (unsigned long));
    696   ChangeMemInUse (chunks_read * sizeof (unsigned long));
    697   bzero ((char *) chunk_ptrs, chunks_read * sizeof (unsigned long));
     695  chunk_ptrs = Xmalloc (chunks_read * sizeof (mg_u_long));
     696  ChangeMemInUse (chunks_read * sizeof (mg_u_long));
     697  bzero ((char *) chunk_ptrs, chunks_read * sizeof (mg_u_long));
    698698
    699699  rbsi = Xmalloc (chunks_read * sizeof (random_bitio_state));
     
    752752          for (k = 0; k < p; k++)
    753753            {
    754               register unsigned long x, tf;
     754              register mg_u_long x, tf;
    755755              BBLOCK_DECODE (x, b);
    756756              if (k == 0)
     
    775775          for (k = 0; k < p; k++)
    776776            {
    777               register unsigned long x, tf;
     777              register mg_u_long x, tf;
    778778              x = BIO_Random_Bblock_Decode (b, Chks, NULL);
    779779              if (k == 0)
     
    816816/*   chunks_read = 0; */
    817817  Xfree (chunk_ptrs);
    818   ChangeMemInUse (-chunks_read * sizeof (unsigned long));
     818  ChangeMemInUse (-chunks_read * sizeof (mg_u_long));
    819819  chunks_read = 0;
    820820  Disk_pos = 0;
     
    860860  int res;
    861861  u_char *end = s_in + l_in - 1;
    862   unsigned long tocode;
    863   unsigned long wl_pos = 0;
     862  mg_u_long tocode;
     863  mg_u_long wl_pos = 0;
    864864
    865865  if (!docs_left)
     
    934934      if (wl_pos)
    935935    {
    936       unsigned long *wl = word_list;
    937       unsigned long i, count, val;
     936      mg_u_long *wl = word_list;
     937      mg_u_long i, count, val;
    938938      qsort (wl, wl_pos, sizeof (*wl), wl_comp);
    939939      count = 1;
     
    999999
    10001000static void
    1001 stats (unsigned long len)
     1001stats (mg_u_long len)
    10021002{
    10031003#ifndef SILENT
     
    10291029done_ivf_2 (char *FileName)
    10301030{
    1031   long i;
     1031  mg_s_long i;
    10321032  mg_ullong totalIbits;
    1033   unsigned long invf_len;
    1034   unsigned long bytes_output;
     1033  mg_u_long invf_len;
     1034  mg_u_long bytes_output;
    10351035  struct invf_file_header ifh;
    10361036
     
    10541054  invf_len = ftell (invf);
    10551055
    1056   fseek (invf_out, sizeof (long), 0);
     1056  fseek (invf_out, sizeof (mg_s_long), 0);
    10571057  /* [RPAP - Jan 97: Endian Ordering] */
    10581058  HTONUL2(dict_size, ifh.no_of_words);
     
    10651065  bytes_output = ftell (invf_out);
    10661066
    1067   totalIbits = sizeof (unsigned long) * 8;      /* The magic number */
     1067  totalIbits = sizeof (mg_u_long) * 8;      /* The magic number */
    10681068  totalIbits += 8 * 200;    /* A 200 byte gap */
    10691069
    10701070  /* find the right place in the file to start reading p values */
    1071   fseek (dict, sizeof (unsigned long) + sizeof (struct invf_dict_header), 0);
     1071  fseek (dict, sizeof (mg_u_long) + sizeof (struct invf_dict_header), 0);
    10721072  for (i = 0; i < dict_size; i++)
    10731073    {
    10741074      invf_state_rec *isr;
    1075       unsigned long fcnt, wcnt, s, e;
    1076       register unsigned long p;
     1075      mg_u_long fcnt, wcnt, s, e;
     1076      register mg_u_long p;
    10771077      u_char dummy1, dummy2[MAXSTEMLEN + 1];
    10781078
     
    11471147  {
    11481148    char *temp_str = msg_prefix;
    1149     unsigned long total;
     1149    mg_u_long total;
    11501150    msg_prefix = "ivf.pass2";
    11511151    stats (invf_len);
  • main/trunk/greenstone2/common-src/indexers/mg/src/text/lists.h

    r16583 r25147  
    3232    float Weight;
    3333    int DocNum;
    34     unsigned long SeekPos;  /* position in the text file in bytes */
    35     unsigned long Len;      /* length of the document in bytes */
     34    mg_u_long SeekPos;  /* position in the text file in bytes */
     35    mg_u_long Len;      /* length of the document in bytes */
    3636    char *CompTextBuffer;
    3737    struct DocEntry *Next;
  • main/trunk/greenstone2/common-src/indexers/mg/src/text/locallib.c

    r16583 r25147  
    100100
    101101int
    102 huffcodebits (unsigned long *A, int n)
     102huffcodebits (mg_u_long *A, int n)
    103103{
    104104  int i, j, tot = 0, bits = 0, v1, v2, *B;
     
    136136
    137137int
    138 modelbits (unsigned long *A, int n)
     138modelbits (mg_u_long *A, int n)
    139139{
    140140  int i, bits = 0, last, N = 0;
     
    185185
    186186int
    187 Read_cdh (FILE * f, compression_dict_header * cdh, u_long * mem,
    188       u_long * disk)
     187Read_cdh (FILE * f, compression_dict_header * cdh, mg_u_long * mem,
     188      mg_u_long * disk)
    189189{
    190190  if (disk)
     
    212212
    213213int
    214 F_Read_cdh (File * f, compression_dict_header * cdh, u_long * mem,
    215         u_long * disk)
     214F_Read_cdh (File * f, compression_dict_header * cdh, mg_u_long * mem,
     215        mg_u_long * disk)
    216216{
    217217  if (disk)
     
    239239
    240240int
    241 Read_cfh (FILE * f, comp_frags_header * cfh, u_long * mem, u_long * disk)
     241Read_cfh (FILE * f, comp_frags_header * cfh, mg_u_long * mem, mg_u_long * disk)
    242242{
    243243  int i;  /* [RPAP - Jan 97: Endian Ordering] */
     
    274274
    275275int
    276 F_Read_cfh (File * f, comp_frags_header * cfh, u_long * mem, u_long * disk)
     276F_Read_cfh (File * f, comp_frags_header * cfh, mg_u_long * mem, mg_u_long * disk)
    277277{
    278278  int i;  /* [RPAP - Jan 97: Endian Ordering] */
  • main/trunk/greenstone2/common-src/indexers/mg/src/text/locallib.h

    r16583 r25147  
    3333int vecentropy (int *A, int n);
    3434
    35 int huffcodebits (unsigned long *A, int n);
     35int huffcodebits (mg_u_long *A, int n);
    3636
    37 int modelbits (unsigned long *A, int n);
     37int modelbits (mg_u_long *A, int n);
    3838
    3939int prime (int p);
    4040
    4141
    42 int Read_cdh (FILE * f, compression_dict_header * cdh, u_long * mem, u_long * disk);
     42int Read_cdh (FILE * f, compression_dict_header * cdh, mg_u_long * mem, mg_u_long * disk);
    4343
    44 int Read_cfh (FILE * f, comp_frags_header * cfh, u_long * mem, u_long * disk);
     44int Read_cfh (FILE * f, comp_frags_header * cfh, mg_u_long * mem, mg_u_long * disk);
    4545
    46 int F_Read_cdh (File * f, compression_dict_header * cdh, u_long * mem,
    47         u_long * disk);
     46int F_Read_cdh (File * f, compression_dict_header * cdh, mg_u_long * mem,
     47        mg_u_long * disk);
    4848
    49 int F_Read_cfh (File * f, comp_frags_header * cfh, u_long * mem, u_long * disk);
     49int F_Read_cfh (File * f, comp_frags_header * cfh, mg_u_long * mem, mg_u_long * disk);
    5050
    5151
  • main/trunk/greenstone2/common-src/indexers/mg/src/text/mg_compression_dict.c

    r16583 r25147  
    4141#include "mg.h"
    4242
    43 #define MAXBITS (sizeof(unsigned long) * 8)
     43#define MAXBITS (sizeof(mg_mg_u_long) * 8)
    4444
    4545/*
     
    9898typedef struct WordData
    9999  {
    100     u_long freq, occur_num;
     100    mg_u_long freq, occur_num;
    101101    float saving;
    102102    float char_bit_cost;
    103     u_long num_trans;
     103    mg_u_long num_trans;
    104104    u_char *word;
    105105  }
     
    107107
    108108static WordData *Words[2];
    109 static u_long Num[2];
    110 static u_long chars[2];
     109static mg_u_long Num[2];
     110static mg_u_long chars[2];
    111111
    112112#define KIND(p) (((p) >= Words[0] && (p) < Words[0] + Num[0]) ? 0 : 1)
     
    118118  {
    119119    WordData **wd;
    120     u_long num_wds;
    121     u_long chars;
     120    mg_u_long num_wds;
     121    mg_u_long chars;
    122122  }
    123123DictData;
     
    129129
    130130static char *file_name = "";
    131 static u_long novel_method = MG_NOVEL_HUFFMAN_CHARS;
     131static mg_u_long novel_method = MG_NOVEL_HUFFMAN_CHARS;
    132132
    133133
     
    136136static void Method3 (int k);
    137137static void Select_all (void);
    138 static u_long WriteOutWords (char *, u_long, int);
     138static mg_u_long WriteOutWords (char *, mg_u_long, int);
    139139static int DecFreqIncWL (void *a, void *b);
    140140static int OccuranceOrder (void *a, void *b);
     
    150150  int lookback = 2;
    151151  double k = 0;
    152   u_long mem_reqd;
     152  mg_u_long mem_reqd;
    153153  opterr = 0;
    154154  msg_prefix = argv[0];
     
    264264{
    265265  FILE *f;
    266   unsigned long i;
     266  mg_u_long i;
    267267  f = open_file (filename, TEXT_STATS_DICT_SUFFIX, "rb",
    268268         MAGIC_STATS_DICT, MG_ABORT);  /* [RPAP - Feb 97: WIN32 Port] */
     
    468468CalcCharCounts (WordData ** wd, int num,
    469469        char *char_lens[2], char *len_lens[2],
    470         u_long escape[2])
    471 {
    472   long char_freqs[2][256];
    473   long len_freqs[2][16];
     470        mg_u_long escape[2])
     471{
     472  mg_u_long char_freqs[2][256];
     473  mg_u_long len_freqs[2][16];
    474474  huff_data hd;
    475475  int i;
     
    480480  for (i = 0; i < num; i++, wd++)
    481481    {
    482       u_long freq = (*wd)->freq;
     482      mg_u_long freq = (*wd)->freq;
    483483      u_char *buf = (*wd)->word;
    484484      int len = *buf++;
     
    487487      escape[idx] += freq;
    488488      for (; len; len--, buf++)
    489     char_freqs[idx][(u_long) (*buf)] += freq;
     489    char_freqs[idx][(mg_u_long) (*buf)] += freq;
    490490    }
    491491  Generate_Huffman_Data (256, char_freqs[0], &hd, NULL);
     
    511511CalcBitCost (WordData ** discard_word, int discard_num,
    512512         WordData ** keep_word, int keep_num, double freqs_trans[2],
    513          u_long escape[2], int num_trans)
     513         mg_u_long escape[2], int num_trans)
    514514{
    515515  char *char_lens[2];
     
    525525      u_char *buf = (*discard_word)->word;
    526526      int len = *buf++;
    527       u_long freq = (*discard_word)->freq;
     527      mg_u_long freq = (*discard_word)->freq;
    528528      int idx = KIND (*discard_word);
    529529
    530530      cbc = len_lens[idx][len];
    531531      for (; len; len--, buf++)
    532     cbc += char_lens[idx][(u_long) (*buf)];
     532    cbc += char_lens[idx][(mg_u_long) (*buf)];
    533533
    534534      (*discard_word)->char_bit_cost = (cbc + esc[idx]) * freq;
     
    546546      u_char *buf = (*keep_word)->word;
    547547      int len = *buf++;
    548       u_long freq = (*keep_word)->freq;
     548      mg_u_long freq = (*keep_word)->freq;
    549549      int idx = KIND (*keep_word);
    550550
    551551      cbc = len_lens[idx][len];
    552552      for (; len; len--, buf++)
    553     cbc += char_lens[idx][(u_long) (*buf)];
     553    cbc += char_lens[idx][(mg_u_long) (*buf)];
    554554
    555555      (*keep_word)->char_bit_cost = (cbc + esc[idx]) * freq;
     
    578578  int recalcs = 0;
    579579  double freqs_trans[2], total;
    580   u_long escape[2];
     580  mg_u_long escape[2];
    581581  WordData **keep_heap, **discard_heap;
    582582
     
    831831
    832832
    833 static u_long
     833static mg_u_long
    834834Write_data (FILE * f, DictData * dd, int lookback)
    835835{
    836   u_long mem_reqd;
     836  mg_u_long mem_reqd;
    837837  huff_data *hd;
    838838  int i;
    839   u_long us = dd->num_wds;
    840   long *freqs;
    841   u_long huff_words_size[MAX_HUFFCODE_LEN + 1];
    842   u_long lencounts[MAX_HUFFCODE_LEN + 1];
     839  mg_u_long us = dd->num_wds;
     840  mg_s_long *freqs;
     841  mg_u_long huff_words_size[MAX_HUFFCODE_LEN + 1];
     842  mg_u_long lencounts[MAX_HUFFCODE_LEN + 1];
    843843  u_char *lastword[MAX_HUFFCODE_LEN + 1];
    844844
     
    932932{
    933933  int j;
    934   long freqs[256];
     934  mg_s_long freqs[256];
    935935  WordData **wd = dd->wd;
    936936  huff_data *hd;
     
    943943      int len = *buf++;
    944944      for (; len; len--, buf++)
    945     freqs[(u_long) (*buf)] += (*wd)->freq;
     945    freqs[(mg_u_long) (*buf)] += (*wd)->freq;
    946946    }
    947947
     
    968968{
    969969  int j;
    970   long freqs[16];
     970  mg_s_long freqs[16];
    971971  WordData **wd = dd->wd;
    972972  huff_data *hd;
     
    995995
    996996
    997 static u_long
    998 WriteOutWords (char *file_name, u_long type, int lookback)
     997static mg_u_long
     998WriteOutWords (char *file_name, mg_u_long type, int lookback)
    999999{
    10001000  FILE *f;
    10011001  int i;
    1002   u_long mem_reqd = 0;
     1002  mg_u_long mem_reqd = 0;
    10031003
    10041004  compression_dict_header cdh;
  • main/trunk/greenstone2/common-src/indexers/mg/src/text/mg_decompress_text.c

    r16583 r25147  
    3434
    3535  int ch;
    36   unsigned long start, finish, len;
    37   u_long total_chars = 0;
     36  mg_u_long start, finish, len;
     37  mg_u_long total_chars = 0;
    3838  u_char *c_buffer = 0;
    3939  int buf_len = -1;
     
    4242  compression_dict *cd = NULL;
    4343  compressed_text_header cth;
    44   u_long doc;
     44  mg_u_long doc;
    4545  int count;
    4646  char *filename = "";
     
    161161
    162162#if 0
    163   printf ("\n#Total chars output = %lu\n", total_chars);
     163  printf ("\n#Total chars output = %u\n", total_chars);
    164164#endif
    165165
  • main/trunk/greenstone2/common-src/indexers/mg/src/text/mg_fast_comp_dict.c

    r16583 r25147  
    9191
    9292
    93 static u_long mem_for_comp_dict (char *filename);
     93static mg_u_long mem_for_comp_dict (char *filename);
    9494static void load_comp_dict (char *filename);
    9595static void save_fast_dict (char *filename);
     
    100100static void *cur;
    101101static u_char *fixup;
    102 static u_long mem, fixup_mem;
     102static uintptr_t mem, fixup_mem;
    103103
    104104int main (int argc, char **argv)
     
    142142  Message ("Actual memory for fast_dict %u", (char *) cur - (char *) buffer);
    143143
    144   if ((u_long) cur > (u_long) buffer + mem)
     144  if ((uintptr_t) cur > (uintptr_t) buffer + mem)
    145145    FatalError (1, "The buffer was not big enough for the dictionary");
    146146
     
    211211unfixup_buffer ()
    212212{
    213   u_long *p;
    214   for (p = buffer; (u_long) p < (u_long) cur; p++)
     213  uintptr_t *p;
     214  for (p = buffer; (uintptr_t) p < (uintptr_t) cur; p++)
    215215    {
    216216      if (IS_FIXUP (p))
    217     *p = *p - (u_long) buffer;
    218     }
    219 }
    220 
    221 
    222 
    223 
    224 static u_long
     217    *p = *p - (uintptr_t) buffer;
     218    }
     219}
     220
     221
     222
     223
     224static mg_u_long
    225225mem_for_aux_dict (compression_dict_header * cdh, char *filename)
    226226{
    227227  int i;
    228   u_long mem = sizeof (auxiliary_dict);
     228  mg_u_long mem = sizeof (auxiliary_dict);
    229229  FILE *aux;
    230230
     
    249249
    250250
    251 static u_long
     251static mg_u_long
    252252mem_for_words (FILE * dict, compression_dict_header * cdh,
    253253           comp_frags_header * cfh)
    254254{
    255   u_long mem = 0;
    256   u_long i, lookback;
     255  mg_u_long mem = 0;
     256  mg_u_long i, lookback;
    257257  int ptrs_reqd = 0;
    258258  int mem_reqd = 0;
     
    282282
    283283
    284 static u_long
     284static mg_u_long
    285285mem_for_comp_dict (char *filename)
    286286{
    287   u_long mem = sizeof (compression_dict);
     287  mg_u_long mem = sizeof (compression_dict);
    288288  compression_dict_header cdh;
    289289  comp_frags_header cfh;
     
    343343      if (hd.clens)
    344344        Xfree (hd.clens);
    345       mem += hd.num_codes * sizeof (unsigned long);
    346       mem += (MAX_HUFFCODE_LEN + 1) * sizeof (unsigned long *);
     345      mem += hd.num_codes * sizeof (mg_u_long);
     346      mem += (MAX_HUFFCODE_LEN + 1) * sizeof (mg_u_long *);
    347347
    348348      mem += sizeof (hd);
     
    350350      if (hd.clens)
    351351        Xfree (hd.clens);
    352       mem += hd.num_codes * sizeof (unsigned long);
    353       mem += (MAX_HUFFCODE_LEN + 1) * sizeof (unsigned long *);
     352      mem += hd.num_codes * sizeof (mg_u_long);
     353      mem += (MAX_HUFFCODE_LEN + 1) * sizeof (mg_u_long *);
    354354    }
    355355    break;
     
    377377          if (hd.clens)
    378378        Xfree (hd.clens);
    379           mem += hd.num_codes * sizeof (unsigned long);
    380           mem += (MAX_HUFFCODE_LEN + 1) * sizeof (unsigned long *);
     379          mem += hd.num_codes * sizeof (mg_u_long);
     380          mem += (MAX_HUFFCODE_LEN + 1) * sizeof (mg_u_long *);
    381381
    382382          mem += sizeof (hd);
     
    384384          if (hd.clens)
    385385        Xfree (hd.clens);
    386           mem += hd.num_codes * sizeof (unsigned long);
    387           mem += (MAX_HUFFCODE_LEN + 1) * sizeof (unsigned long *);
     386          mem += hd.num_codes * sizeof (mg_u_long);
     387          mem += (MAX_HUFFCODE_LEN + 1) * sizeof (mg_u_long *);
    388388          break;
    389389        case MG_NOVEL_BINARY:
     
    413413
    414414void *
    415 getmem (u_long size, int align)
     415getmem (mg_u_long size, int align)
    416416{
    417417  void *res;
    418   cur = (void *) (((u_long) cur + (align - 1)) & (~(align - 1)));
     418  cur = (void *) (((uintptr_t) cur + (align - 1)) & (~(align - 1)));
    419419  res = cur;
    420420  cur = (char *) cur + size;
    421   if ((long) cur > (long) buffer + mem)
     421  if ((intptr_t) cur > (intptr_t) buffer + mem)
    422422    FatalError (1, "The buffer was not big enough for the dictionary");
    423423  return res;
     
    592592
    593593
    594 static unsigned long **
    595 Generate_Fast_Huffman_Vals (huff_data * data, u_long * mem)
     594static mg_u_long **
     595Generate_Fast_Huffman_Vals (huff_data * data, mg_u_long * mem)
    596596{
    597597  int i;
    598   unsigned long *fcode[MAX_HUFFCODE_LEN + 1];
    599   unsigned long **values;
    600   unsigned long *vals;
     598  mg_u_long *fcode[MAX_HUFFCODE_LEN + 1];
     599  mg_u_long **values;
     600  mg_u_long *vals;
    601601
    602602  if (!data)
    603603    return (NULL);
    604   vals = getmem (data->num_codes * sizeof (*vals), sizeof (long *));
    605   values = getmem ((MAX_HUFFCODE_LEN + 1) * sizeof (unsigned long *),
    606            sizeof (long *));
    607 
    608   bzero ((char *) values, (MAX_HUFFCODE_LEN + 1) * sizeof (unsigned long *));
     604  vals = getmem (data->num_codes * sizeof (*vals), sizeof (mg_s_long *));
     605  values = getmem ((MAX_HUFFCODE_LEN + 1) * sizeof (mg_u_long *),
     606           sizeof (mg_s_long *));
     607
     608  bzero ((char *) values, (MAX_HUFFCODE_LEN + 1) * sizeof (mg_u_long *));
    609609
    610610  if (mem)
    611611    *mem += data->num_codes * sizeof (*vals) +
    612       (MAX_HUFFCODE_LEN + 1) * sizeof (unsigned long *);
     612      (MAX_HUFFCODE_LEN + 1) * sizeof (mg_u_long *);
    613613
    614614  fcode[0] = values[0] = &vals[0];
     
    661661    {
    662662      huff_data *hd;
    663       u_long **vals;
     663      mg_u_long **vals;
    664664      if (cd->cdh.num_words[which])
    665665        {
     
    702702    {
    703703      huff_data *hd;
    704       u_long **vals;
     704      mg_u_long **vals;
    705705      if (cd->cdh.num_words[which])
    706706        {
     
    776776
    777777  {
    778     u_long *p;
    779     for (p = buffer; (u_long) p < (u_long) cur; p++)
     778    uintptr_t *p;
     779    for (p = buffer; (uintptr_t) p < (uintptr_t) cur; p++)
    780780      {
    781781    if (IS_FIXUP (p))
  • main/trunk/greenstone2/common-src/indexers/mg/src/text/mg_files.c

    r16583 r25147  
    110110FILE *
    111111open_named_file (const char *name, const char *mode,
    112          u_long magic_num, int err_mode)
    113 {
    114   unsigned long magic;
     112         mg_u_long magic_num, int err_mode)
     113{
     114  mg_u_long magic;
    115115  FILE *f = NULL;
    116116  char *err;
     
    172172FILE *
    173173open_file (const char *name, const char *suffix, const char *mode,
    174        u_long magic_num, int err_mode)
     174       mg_u_long magic_num, int err_mode)
    175175{
    176176  char path[512];
     
    200200FILE *
    201201create_named_file (const char *name, const char *mode,
    202            u_long magic_num, int err_mode)
     202           mg_u_long magic_num, int err_mode)
    203203{
    204204  FILE *f = NULL;
     
    252252FILE *
    253253create_file (const char *name, const char *suffix, const char *mode,
    254          u_long magic_num, int err_mode)
     254         mg_u_long magic_num, int err_mode)
    255255{
    256256  char path[512];
  • main/trunk/greenstone2/common-src/indexers/mg/src/text/mg_files.h

    r16583 r25147  
    2929/* Magic numbers for the different types of files */
    3030
    31 #define GEN_MAGIC(a,b,c,d) ((unsigned long)(((a)<<24) + ((b)<<16) + \
     31#define GEN_MAGIC(a,b,c,d) ((mg_u_long)(((a)<<24) + ((b)<<16) + \
    3232                        ((c)<<8) + (d)))
    3333
     
    5555#define MAGIC_STEM_3            GEN_MAGIC('M','G','s','3')
    5656
    57 #define IS_MAGIC(a) ((((u_long)(a)) & 0xffff0000) == MAGIC_XXXX)
     57#define IS_MAGIC(a) ((((mg_u_long)(a)) & 0xffff0000) == MAGIC_XXXX)
    5858
    5959
     
    268268   an error message.   */
    269269FILE *open_named_file (const char *name, const char *mode,
    270                u_long magic_num, int err_mode);
     270               mg_u_long magic_num, int err_mode);
    271271
    272272
     
    286286   an error message.   */
    287287FILE *open_file (const char *name, const char *suffix, const char *mode,
    288          u_long magic_num, int err_mode);
     288         mg_u_long magic_num, int err_mode);
    289289
    290290
     
    305305   an error message.   */
    306306FILE *create_named_file (const char *name, const char *mode,
    307              u_long magic_num, int err_mode);
     307             mg_u_long magic_num, int err_mode);
    308308
    309309
     
    322322   an error message.   */
    323323FILE *create_file (const char *name, const char *suffix, const char *mode,
    324            u_long magic_num, int err_mode);
    325 
    326 
    327 
    328 
    329 #endif
     324           mg_u_long magic_num, int err_mode);
     325
     326
     327
     328
     329#endif
  • main/trunk/greenstone2/common-src/indexers/mg/src/text/mg_invf_dict.c

    r16583 r25147  
    115115{
    116116  FILE *id, *idb, *tmp, *ii;
    117   unsigned long i, pos, num, First_word, invf_ptr, invf_len;
    118   unsigned long last_ptr = 0;
     117  mg_u_long i, pos, num, First_word, invf_ptr, invf_len;
     118  mg_u_long last_ptr = 0;
    119119  char *FName;
    120120  struct invf_dict_header idh;
     
    179179  for (i = 0; i < idh.dict_size; i++)
    180180    {
    181       register unsigned long extra, copy, suff;
    182       unsigned long wcnt, fcnt;
     181      register mg_u_long extra, copy, suff;
     182      mg_u_long wcnt, fcnt;
    183183
    184184      /* build a new word on top of prev */
     
    304304
    305305  rewind (tmp);
    306   sdh.blocks_start = sdh.index_chars + sizeof (u_long) + sizeof (sdh) +
     306  sdh.blocks_start = sdh.index_chars + sizeof (mg_u_long) + sizeof (sdh) +
    307307    sdh.num_blocks * sizeof (pos);
    308308  if (force)
     
    323323
    324324  /* skip over the magic number */
    325   fseek (idb, sizeof (u_long), 0);
     325  fseek (idb, sizeof (mg_u_long), 0);
    326326
    327327  /* [RPAP - Jan 97: Endian Ordering] */
  • main/trunk/greenstone2/common-src/indexers/mg/src/text/mg_invf_dump.c

    r16583 r25147  
    3636#include "invf.h"
    3737
    38 extern unsigned long S_btg;
     38extern mg_u_long S_btg;
    3939
    4040/*
     
    124124process_files (char *name)
    125125{
    126   unsigned long N, Nstatic, k;
     126  mg_u_long N, Nstatic, k;
    127127  FILE *dict;
    128128  FILE *invf;
     
    172172    }
    173173  else
    174     printf ("%ld %ld\n", N, ifh.no_of_words);
     174    printf ("%d %d\n", N, ifh.no_of_words);
    175175  for (k = 0; k < ifh.no_of_words; k++)
    176176    {
    177177      int i, blk, doc;
    178       register unsigned long suff, prefix;
    179       unsigned long fcnt, wcnt;
     178      register mg_u_long suff, prefix;
     179      mg_u_long fcnt, wcnt;
    180180      char term[MAXSTEMLEN + 1];
    181181
     
    196196    {
    197197      if (term_dump)
    198         printf ("%ld    \"%s\"\n", fcnt, term);
     198        printf ("%d    \"%s\"\n", fcnt, term);
    199199      else
    200         printf ("%ld\n", fcnt);
     200        printf ("%d\n", fcnt);
    201201    }
    202202      blk = BIO_Bblock_Init (Nstatic, fcnt);
     
    215215          GAMMA_DECODE (count);
    216216          if (word_counts)
     217        {
    217218        if (binary)
     219          {
    218220          fwrite ((char *) &count, sizeof (count), 1, stdout);
     221          }
    219222        else
     223          {
    220224          printf (" %d", count);
     225          }
     226        }
    221227        }
    222228      if (!binary)
  • main/trunk/greenstone2/common-src/indexers/mg/src/text/mg_invf_merge.c

    r16583 r25147  
    5858    struct invf_dict_header idh;
    5959    struct invf_file_header ifh;
    60     u_long nDocs;
     60    mg_u_long nDocs;
    6161
    6262    /* Lexicon processing variables */
    63     u_long fcnt, wcnt;
     63    mg_u_long fcnt, wcnt;
    6464    int suff, pref;
    6565    unsigned char term[MAXSTEMLEN + 1];
    66     u_long term_count;
     66    mg_u_long term_count;
    6767    int done;
    6868
    6969    /* Variables used for merging */
    7070    struct stdio_bitio_state sbs;   /* for bit-based I/O on inverted files */
    71     u_long nTerms;      /* = number of invf entries */
     71    mg_u_long nTerms;       /* = number of invf entries */
    7272    int *fcntlist;      /* store fcnt values read in from the lexicons */
    7373
     
    8181
    8282merge_info m[3];        /*  m[OLD], m[NEW] and m[MERGE] */
    83 u_long magicsize;       /* how big is magic number? currently always 4 */
    84 u_long Nstatic;         /* static # of documents in file */
     83mg_u_long magicsize;        /* how big is magic number? currently always 4 */
     84mg_u_long Nstatic;          /* static # of documents in file */
    8585
    8686float *DocWeightBuffer;
     
    9797int fastMerge = 1;      /* True if fast merge selected. Default = true */
    9898
    99 u_long oldIdxValue;     /* stores last read value from m[OLD].idx
     99mg_u_long oldIdxValue;      /* stores last read value from m[OLD].idx
    100100                   Used to calculate entry lengths */
    101 u_long bytes_output;        /* for writing .invf.idx file */
    102 u_long oldOnlyBits = 0;     /* entries in old only */
    103 u_long oldMergeBits = 0;    /* entries in old that are merged with
     101mg_u_long bytes_output;     /* for writing .invf.idx file */
     102mg_u_long oldOnlyBits = 0;      /* entries in old only */
     103mg_u_long oldMergeBits = 0; /* entries in old that are merged with
    104104                   a new entry */
    105105
     
    242242  m[OLD].idx = open_file (m[OLD].fname, INVF_IDX_SUFFIX, "rb",
    243243              MAGIC_INVI, MG_ABORT);
    244   fread (&oldIdxValue, sizeof (u_long), 1, m[OLD].idx);
     244  fread (&oldIdxValue, sizeof (mg_u_long), 1, m[OLD].idx);
    245245  NTOHUL(oldIdxValue);  /* [RPAP - Jan 97: Endian Ordering] */
    246246
     
    280280 *=======================================================================*/
    281281void
    282 procEntry_slow (int tnum, int type, u_long oldN, u_long newN, u_long mergeN)
     282procEntry_slow (int tnum, int type, mg_u_long oldN, mg_u_long newN, mg_u_long mergeN)
    283283/*
    284284 *  Process an invf entry.
     
    295295  int fcntNEW = m[NEW].fcntlist[tnum];
    296296  int inblk, outblk;
    297   u_long inbits = 0, outbits = 0;
     297  mg_u_long inbits = 0, outbits = 0;
    298298
    299299  /* write .invf.idx pointer */
    300300  HTONUL(bytes_output);  /* [RPAP - Jan 97: Endian Ordering] */
    301   fwrite (&bytes_output, sizeof (u_long), 1, m[MERGE].idx);
     301  fwrite (&bytes_output, sizeof (mg_u_long), 1, m[MERGE].idx);
    302302  NTOHUL(bytes_output);  /* [RPAP - Jan 97: Endian Ordering] */
    303303
     
    383383 */
    384384{
    385   u_long newIdxValue, len = 0;
     385  mg_u_long newIdxValue, len = 0;
    386386
    387387  /* Calculate IFold entry length in bytes if not NEW type */
    388388  if (type != NEW)      /* read in an index number from m[OLD].idx */
    389389    {
    390       fread (&newIdxValue, sizeof (u_long), 1, m[OLD].idx);
     390      fread (&newIdxValue, sizeof (mg_u_long), 1, m[OLD].idx);
    391391      NTOHUL(newIdxValue);  /* [RPAP - Jan 97: Endian Ordering] */
    392392      len = newIdxValue - oldIdxValue;
     
    400400      /* write .invf.idx pointer */
    401401      HTONUL(bytes_output);  /* [RPAP - Jan 97: Endian Ordering] */
    402       fwrite (&bytes_output, sizeof (u_long), 1, m[MERGE].idx);
     402      fwrite (&bytes_output, sizeof (mg_u_long), 1, m[MERGE].idx);
    403403      NTOHUL(bytes_output);  /* [RPAP - Jan 97: Endian Ordering] */
    404404
     
    468468  m[x].term_count = m[x].term_count + 1;
    469469
    470   fread ((char *) &(m[x].fcnt), sizeof (u_long), 1, m[x].dict);
    471   fread ((char *) &(m[x].wcnt), sizeof (u_long), 1, m[x].dict);
     470  fread ((char *) &(m[x].fcnt), sizeof (mg_u_long), 1, m[x].dict);
     471  fread ((char *) &(m[x].wcnt), sizeof (mg_u_long), 1, m[x].dict);
    472472
    473473  /* [RPAP - Jan 97: Endian Ordering] */
     
    620620  /* print some results about terms */
    621621  {
    622     fprintf (stderr, "   Terms: OLD = %ld,  NEW = %ld,  MERGE = %ld\n",
     622    fprintf (stderr, "   Terms: OLD = %d,  NEW = %d,  MERGE = %d\n",
    623623         m[OLD].nTerms, m[NEW].nTerms, m[MERGE].nTerms);
    624     fprintf (stderr, "   In OLD only: %ld,  In NEW only: %ld,  BOTH: %ld\n",
     624    fprintf (stderr, "   In OLD only: %d,  In NEW only: %d,  BOTH: %d\n",
    625625         (m[MERGE].nTerms - m[NEW].nTerms),
    626626         (m[MERGE].nTerms - m[OLD].nTerms),
     
    645645    /* write final .invf.idx pointer */
    646646    HTONUL(bytes_output);  /* [RPAP - Jan 97: Endian Ordering] */
    647     fwrite (&bytes_output, sizeof (u_long), 1, m[MERGE].idx);
     647    fwrite (&bytes_output, sizeof (mg_u_long), 1, m[MERGE].idx);
    648648    NTOHUL(bytes_output);  /* [RPAP - Jan 97: Endian Ordering] */
    649649
    650     fprintf (stderr, "Old invf: old only bits: %ld, merged bits: %ld\n",
     650    fprintf (stderr, "Old invf: old only bits: %d, merged bits: %d\n",
    651651         oldOnlyBits, oldMergeBits);
    652652  }
     
    729729      if (weightfile)
    730730    {
    731       u_long i;  /* [RPAP - Jan 97: Endian Ordering] */
    732 
    733       fprintf (stderr, "writing new weights: Nnew = %ld\n", m[NEW].nDocs);
     731      mg_u_long i;  /* [RPAP - Jan 97: Endian Ordering] */
     732
     733      fprintf (stderr, "writing new weights: Nnew = %d\n", m[NEW].nDocs);
    734734      fseek (weightfile, 0, 2); /* end of file */
    735735
  • main/trunk/greenstone2/common-src/indexers/mg/src/text/mg_invf_rebuild.c

    r16583 r25147  
    4343typedef struct invf_info
    4444  {
    45     unsigned long doc_num, count, bits_so_far, count_bits;
     45    mg_u_long doc_num, count, bits_so_far, count_bits;
    4646  }
    4747invf_info;
     
    200200{
    201201  FILE *in, *out, *idx, *odx, *dict;
    202   unsigned long magic, outmode, N, in_k, out_k;
    203   unsigned long bits_out, bytes_out, i, j;
     202  mg_u_long magic, outmode, N, in_k, out_k;
     203  mg_u_long bits_out, bytes_out, i, j;
    204204  stdio_bitio_state out_buf, in_buf;
    205205  struct invf_dict_header idh;
     
    351351  for (i = 0; i < ifh_in.no_of_words; i++)
    352352    {
    353       unsigned long blk, p;
    354       unsigned long odn_blk = 0, olen_blk = 0;
    355       unsigned long idn_blk = 0, ilen_blk = 0;
    356       register unsigned long suff;
    357       unsigned long fcnt, wcnt, doc_num, bits_so_far, last_major;
    358       unsigned long next_mjr_dn, kd;
     353      mg_u_long blk, p;
     354      mg_u_long odn_blk = 0, olen_blk = 0;
     355      mg_u_long idn_blk = 0, ilen_blk = 0;
     356      register mg_u_long suff;
     357      mg_u_long fcnt, wcnt, doc_num, bits_so_far, last_major;
     358      mg_u_long next_mjr_dn, kd;
    359359      char dummy2[MAXSTEMLEN + 1];
    360360      invf_info *ii;
     
    380380    case 1:
    381381      {
    382         unsigned long len;
     382        mg_u_long len;
    383383        if (p <= ifh_out.params[0])
    384384          out_k = 0;
     
    396396    case 2:
    397397      {
    398         unsigned long len;
     398        mg_u_long len;
    399399        if (p <= mins)
    400400          out_k = 0;
     
    421421    case 1:
    422422      {
    423         unsigned long len;
     423        mg_u_long len;
    424424        if (p <= ifh_in.params[0])
    425425          in_k = 0;
     
    437437    case 2:
    438438      {
    439         unsigned long len;
     439        mg_u_long len;
    440440        if (p <= ifh_in.params[1])
    441441          {
     
    469469    for (j = 0; j < p; j++, kd++)
    470470    {
    471       unsigned long doc_diff, count = 0;
     471      mg_u_long doc_diff, count = 0;
    472472      if (kd == in_k)
    473473        kd = 0;
  • main/trunk/greenstone2/common-src/indexers/mg/src/text/mg_passes.c

    r16583 r25147  
    103103#define TERMRECORD  '\002'
    104104
    105 unsigned long buf_size = 3 * 1024 * 1024;   /* 3Mb */
    106 unsigned long invf_buffer_size = 5 * 1024 * 1024;   /* 5Mb */
    107 unsigned long ChunkLimit = 0;
     105mg_u_long buf_size = 3 * 1024 * 1024;   /* 3Mb */
     106mg_u_long invf_buffer_size = 5 * 1024 * 1024;   /* 5Mb */
     107mg_u_long ChunkLimit = 0;
    108108char InvfLevel = 2;
    109109char SkipSGML = 0;
     
    117117
    118118static char Passes = 0;
    119 static unsigned long trace = 0;
     119static mg_u_long trace = 0;
    120120static int Dump = 0;
    121121static char **files = NULL;
     
    181181#if 0
    182182static char *
    183 str_comma (unsigned long u)
     183str_comma (mg_u_long u)
    184184{
    185185  static char buf[20];
    186   unsigned long a, b, c, d;
     186  mg_u_long a, b, c, d;
    187187  a = u / 1000000000;
    188188  u -= a * 1000000000;
     
    229229
    230230  char *buffer = Xmalloc (buf_size);
    231   unsigned long num_docs = 0;
    232   unsigned long block_bytes = 0;
     231  mg_u_long num_docs = 0;
     232  mg_u_long block_bytes = 0;
    233233  register int buf_left = buf_size;
    234234  register char *look_pos = buffer;
     
    358358          }
    359359        if (Trace)
    360           fprintf (Trace, "%11" ULL_FS " bytes |%7lu docs | %s\n",
     360          fprintf (Trace, "%11" ULL_FS " bytes |%7u docs | %s\n",
    361361               bytes_processed, num_docs,
    362362               ElapsedTime (&StartTime, NULL));
     
    383383          mi = mallinfo ();
    384384          block_bytes -= trace;
    385           fprintf (Trace, "%11" ULL_FS " bytes |%7lu docs |%7.3f Mb | %s\n",
     385          fprintf (Trace, "%11" ULL_FS " bytes |%7u docs |%7.3f Mb | %s\n",
    386386               bytes_processed, num_docs, mi.arena / 1024.0 / 1024.0,
    387387               ElapsedTime (&StartTime, NULL));
    388388#else
    389389          block_bytes -= trace;
    390           fprintf (Trace, "%11" ULL_FS " bytes |%7lu docs | %s\n",
     390          fprintf (Trace, "%11" ULL_FS " bytes |%7u docs | %s\n",
    391391               bytes_processed, num_docs,
    392392               ElapsedTime (&StartTime, NULL));
     
    439439      struct mallinfo mi;
    440440      mi = mallinfo ();
    441       fprintf (Trace, "%11" ULL_FS " bytes |%7lu docs |%7.3f Mb | %s\n",
     441      fprintf (Trace, "%11" ULL_FS " bytes |%7u docs |%7.3f Mb | %s\n",
    442442           bytes_processed, num_docs, mi.arena / 1024.0 / 1024.0,
    443443           ElapsedTime (&StartTime, NULL));
    444444#else
    445       fprintf (Trace, "%11" ULL_FS " bytes |%7lu docs | %s\n",
     445      fprintf (Trace, "%11" ULL_FS " bytes |%7u docs | %s\n",
    446446           bytes_processed, num_docs,
    447447           ElapsedTime (&StartTime, NULL));
     
    563563      break;
    564564    case 't':
    565       trace = (unsigned long) (atof (optarg) * 1024 * 1024);
     565      trace = (mg_u_long) (atof (optarg) * 1024 * 1024);
    566566      break;
    567567    case 'M':
  • main/trunk/greenstone2/common-src/indexers/mg/src/text/mg_passes_4jni.c

    r16583 r25147  
    5757#define TERMRECORD  '\002'
    5858
    59 unsigned long buf_size = 3 * 1024 * 1024;   /* 3Mb */
    60 unsigned long invf_buffer_size = 5 * 1024 * 1024;   /* 5Mb */
    61 unsigned long ChunkLimit = 0;
     59mg_u_long buf_size = 3 * 1024 * 1024;   /* 3Mb */
     60mg_u_long invf_buffer_size = 5 * 1024 * 1024;   /* 5Mb */
     61mg_u_long ChunkLimit = 0;
    6262char InvfLevel = 2;
    6363char SkipSGML = 0;
     
    7171FILE * Trace;
    7272char * filename;
    73 unsigned long num_docs = 0;
    74 unsigned long block_bytes = 0;
     73mg_u_long num_docs = 0;
     74mg_u_long block_bytes = 0;
    7575
    7676static char Passes = 0;
    77 static unsigned long trace = 0;
     77static mg_u_long trace = 0;
    7878static int Dump = 0;
    7979static char **files = NULL;
     
    193193
    194194/* -b arg to mg_passes */
    195 void set_buffer_size(long size) {
     195void set_buffer_size(mg_s_long size) {
    196196  buf_size = size * 1024;
    197197  if (buf_size <  MIN_BUF) {
     
    201201
    202202/* -c arg to mg_passes */
    203 void set_chunk_limit(long chunk_limit) {
     203void set_chunk_limit(mg_s_long chunk_limit) {
    204204  ChunkLimit = chunk_limit;
    205205}
     
    259259/* -t arg to mg_passes */
    260260void set_trace_point(int tracepos) {
    261   trace = (unsigned long) (tracepos * 1024 * 1024);
     261  trace = (mg_u_long) (tracepos * 1024 * 1024);
    262262}
    263263
     
    410410          }
    411411        if (Trace)
    412           fprintf (Trace, "%11" ULL_FS " bytes |%7lu docs | %s\n",
     412          fprintf (Trace, "%11" ULL_FS " bytes |%7u docs | %s\n",
    413413               bytes_processed, num_docs,
    414414               ElapsedTime (&StartTime, NULL));
     
    435435      mi = mallinfo ();
    436436      block_bytes -= trace;
    437       fprintf (Trace, "%11" ULL_FS " bytes |%7lu docs |%7.3f Mb | %s\n",
     437      fprintf (Trace, "%11" ULL_FS " bytes |%7u docs |%7.3f Mb | %s\n",
    438438           bytes_processed, num_docs, mi.arena / 1024.0 / 1024.0,
    439439           ElapsedTime (&StartTime, NULL));
    440440#else
    441441      block_bytes -= trace;
    442       fprintf (Trace, "%11" ULL_FS " bytes |%7lu docs | %s\n",
     442      fprintf (Trace, "%11" ULL_FS " bytes |%7u docs | %s\n",
    443443           bytes_processed, num_docs,
    444444           ElapsedTime (&StartTime, NULL));
     
    492492      struct mallinfo mi;
    493493      mi = mallinfo ();
    494       fprintf (Trace, "%11" ULL_FS " bytes |%7lu docs |%7.3f Mb | %s\n",
     494      fprintf (Trace, "%11" ULL_FS " bytes |%7u docs |%7.3f Mb | %s\n",
    495495           bytes_processed, num_docs, mi.arena / 1024.0 / 1024.0,
    496496           ElapsedTime (&StartTime, NULL));
    497497#else
    498       fprintf (Trace, "%11" ULL_FS " bytes |%7lu docs | %s\n",
     498      fprintf (Trace, "%11" ULL_FS " bytes |%7u docs | %s\n",
    499499           bytes_processed, num_docs,
    500500           ElapsedTime (&StartTime, NULL));
  • main/trunk/greenstone2/common-src/indexers/mg/src/text/mg_passes_4jni.h

    r16583 r25147  
    4040
    4141/* -b arg to mg_passes */
    42 void set_buffer_size(long size);
     42void set_buffer_size(mg_s_long size);
    4343
    4444/* -c arg to mg_passes */
    45 void set_chunk_limit(long chunk_limit);
     45void set_chunk_limit(mg_s_long chunk_limit);
    4646
    4747/* -C arg to mg_passes */
  • main/trunk/greenstone2/common-src/indexers/mg/src/text/mg_perf_hash_build.c

    r16583 r25147  
    116116{
    117117  FILE *dict, *hash;
    118   unsigned long i;
     118  mg_u_long i;
    119119  u_char prev[MAXSTEMLEN + 1];
    120120  struct invf_dict_header idh;
     
    154154  for (i = 0; i < idh.dict_size; i++)
    155155    {
    156       register unsigned long copy, suff, l;
    157       unsigned long wcnt, fcnt;
     156      register mg_u_long copy, suff, l;
     157      mg_u_long wcnt, fcnt;
    158158
    159159      /* build a new word on top of prev */
  • main/trunk/greenstone2/common-src/indexers/mg/src/text/mg_stem_idx.c

    r16583 r25147  
    6969
    7070
    71 static unsigned long MaxMemInUse = 0;
    72 static unsigned long MemInUse = 0;
     71static mg_u_long MaxMemInUse = 0;
     72static mg_u_long MemInUse = 0;
    7373
    7474static idx_hash_rec **IdxHashTable;
    75 static unsigned long IdxHashSize;
    76 static unsigned long IdxHashUsed;
     75static mg_u_long IdxHashSize;
     76static mg_u_long IdxHashUsed;
    7777static u_char *IdxPool;
    7878static int IdxPoolLeft;
     
    8888int force = 0;
    8989
    90 static long lookback = 4;
     90static mg_s_long lookback = 4;
    9191
    9292static void
     
    216216ReadStemDictBlk (File * stem_file)
    217217{
    218   unsigned long i;
     218  mg_u_long i;
    219219  stemmed_dict *sd;
    220220  u_char *buffer;
     
    357357      register unsigned int res;
    358358      int num_indexes;
    359       unsigned long *first_word, *last_invf_len;
     359      mg_u_long *first_word, *last_invf_len;
    360360      unsigned short *num_words;
    361361      u_char *base;
     
    368368
    369369      /* Move through block header */
    370       first_word = (unsigned long *) (sd->buffer);
     370      first_word = (mg_u_long *) (sd->buffer);
    371371      NTOHUL(*first_word);  /* [RPAP - Jan 97: Endian Ordering] */
    372       last_invf_len = (unsigned long *) (first_word + 1);
     372      last_invf_len = (mg_u_long *) (first_word + 1);
    373373      NTOHUL(*last_invf_len);  /* [RPAP - Jan 97: Endian Ordering] */
    374374      num_words = (unsigned short *) (last_invf_len + 1);
     
    404404
    405405      /* Skip irrelevant word info */
    406       base += sizeof (u_long);
    407       base += sizeof (u_long);
    408       base += sizeof (u_long);
     406      base += sizeof (mg_u_long);
     407      base += sizeof (mg_u_long);
     408      base += sizeof (mg_u_long);
    409409
    410410      /* Stem word */
     
    419419        {
    420420          /* Search the idx hash table for word */
    421           register unsigned long hashval, step;
     421          register mg_u_long hashval, step;
    422422          register int hsize = IdxHashSize;
    423423          HASH (hashval, step, word, hsize);
     
    516516        {
    517517          idx_hash_rec **ht;
    518           unsigned long size;
    519           unsigned long i;
     518          mg_u_long size;
     519          mg_u_long i;
    520520          size = prime (IdxHashSize * 2);
    521521          if (!(ht = Xmalloc (sizeof (idx_hash_rec *) * size)))
     
    529529            register u_char *wptr;
    530530            idx_hash_rec *ent;
    531             register unsigned long hashval, step;
     531            register mg_u_long hashval, step;
    532532           
    533533            wptr = IdxHashTable[i]->word;
     
    568568{
    569569  char *FName;
    570   unsigned long i, j, pos, First_word, num;
     570  mg_u_long i, j, pos, First_word, num;
    571571  struct stem_idx_header sih;
    572572  u_char *buffer, *last_word = NULL;
     
    636636  for (i = 0; i < IdxHashUsed; i++)
    637637    {
    638       register unsigned long extra, copy, suff;
     638      register mg_u_long extra, copy, suff;
    639639      register struct idx_hash_rec *ent = IdxHashTable[i];
    640640
     
    765765
    766766  rewind (tmp);
    767   sih.blocks_start = sih.index_chars + sizeof (u_long) + sizeof (sih) +
     767  sih.blocks_start = sih.index_chars + sizeof (mg_u_long) + sizeof (sih) +
    768768    sih.num_blocks * sizeof (pos);
    769769  if (force)
     
    784784
    785785  /* skip over the magic number */
    786   fseek (idbi, sizeof (u_long), 0);
     786  fseek (idbi, sizeof (mg_u_long), 0);
    787787
    788788  /* [RPAP - Jan 97: Endian Ordering] */
     
    821821  sdh.indexed |= 1 << (stem_method - 1);
    822822  HTONUL(sdh.indexed);
    823   fseek (idb, sizeof (u_long), 0);
     823  fseek (idb, sizeof (mg_u_long), 0);
    824824  fwrite ((char *) &sdh, sizeof (sdh), 1, idb);
    825825  fclose (idb);
  • main/trunk/greenstone2/common-src/indexers/mg/src/text/mg_text_estimate.c

    r16583 r25147  
    9191typedef struct stats_t
    9292  {
    93     u_long freq, occur;
    94     u_long len;
     93    mg_u_long freq, occur;
     94    mg_u_long len;
    9595  }
    9696stats_t;
    9797
    98 static u_long huff_count = 0;
    99 static u_long escape_count = 0;
     98static mg_u_long huff_count = 0;
     99static mg_u_long escape_count = 0;
    100100
    101101
     
    106106static double ReadInWordsSpecial (char *name, double *num_bytes,
    107107                  double *num_extra_bytes,
    108                   u_long *aux_compressed);
     108                  mg_u_long *aux_compressed);
    109109
    110110
     
    116116  ProgTime StartTime;
    117117  double num_bytes, num_extra_bytes = 0; /* [RJM 07/97: 4G limit] */
    118   u_long aux_compressed;
     118  mg_u_long aux_compressed;
    119119  int ch;
    120120  double bytes;
     
    207207  compression_stats_header csh;
    208208  FILE *f;
    209   u_long which;
     209  mg_u_long which;
    210210  double bytes, bits = 0;
    211211
     
    246246      if (ht[which])
    247247        {
    248           register unsigned long hashval, step;
     248          register mg_u_long hashval, step;
    249249          register int tsize = ht[which]->size;
    250250          register u_char **wptr;
     
    335335  bits += 5.5 * csh.num_docs;
    336336
    337   bytes = bits / 8 + sizeof (compressed_text_header) + sizeof (u_long);
     337  bytes = bits / 8 + sizeof (compressed_text_header) + sizeof (mg_u_long);
    338338
    339339  *num_bytes = csh.num_bytes;
     
    356356ReadInWordsSpecial (char *name, double *num_bytes,
    357357            double *num_extra_bytes,
    358             u_long *aux_compressed)
     358            mg_u_long *aux_compressed)
    359359{
    360360  compression_stats_header csh;
    361361  FILE *f;
    362   u_long magic, which;
     362  mg_u_long magic, which;
    363363  double bytes, bits = 0;
    364364  double size[2];
     
    386386      frags_stats_header fsh;
    387387      int j, num = 0;
    388       long lens[16], chars[256];
     388      mg_s_long lens[16], chars[256];
    389389
    390390      bzero ((char *) lens, sizeof (lens));
     
    420420      if (ht[which])
    421421        {
    422           register unsigned long hashval, step;
     422          register mg_u_long hashval, step;
    423423          register int tsize = ht[which]->size;
    424424          register u_char **wptr;
     
    489489    int j, num_buckets = 0;
    490490    int start[10], end[10];
    491     long flens[16], fchars[256];
     491    mg_u_long flens[16], fchars[256];
    492492
    493493    for (j = 0; j < 256; j++)
     
    577577  bits += 5.5 * csh.num_docs;
    578578
    579   bytes = bits / 8 + sizeof (compressed_text_header) + sizeof (u_long);
     579  bytes = bits / 8 + sizeof (compressed_text_header) + sizeof (mg_u_long);
    580580
    581581  *num_bytes = csh.num_bytes;
  • main/trunk/greenstone2/common-src/indexers/mg/src/text/mg_text_merge.c

    r16583 r25147  
    4343FileName old_name, new_name, merge_name;
    4444
    45 long magicsize;         /* == where the header in a file begins */
     45mg_s_long magicsize;            /* == where the header in a file begins */
    4646
    4747compressed_text_header cth[3];
     
    100100{
    101101  int i;
    102   u_long data, offset;
     102  mg_u_long data, offset;
    103103  byte c;
    104104
     
    135135  for (i = 0; i < cth[OLD].num_of_docs; i++)
    136136    {
    137       fread (&data, sizeof (u_long), 1, idx[OLD]);
    138       fwrite (&data, sizeof (u_long), 1, idx[MERGE]);
     137      fread (&data, sizeof (mg_u_long), 1, idx[OLD]);
     138      fwrite (&data, sizeof (mg_u_long), 1, idx[MERGE]);
    139139    }
    140140
    141141  /* offset is the amount to add to each entry from idx[NEW] */
    142   fread (&offset, sizeof (u_long), 1, idx[OLD]);
     142  fread (&offset, sizeof (mg_u_long), 1, idx[OLD]);
    143143  NTOHUL(offset);  /* [RPAP - Jan 97: Endian Ordering] */
    144144  offset -= (4 + sizeof (cth[OLD]));    /* 4 for the magic number */
     
    146146  for (i = 0; i < cth[NEW].num_of_docs; i++)
    147147    {
    148       fread (&data, sizeof (u_long), 1, idx[NEW]);
     148      fread (&data, sizeof (mg_u_long), 1, idx[NEW]);
    149149      NTOHUL(data);  /* [RPAP - Jan 97: Endian Ordering] */
    150150      data += offset;
    151151      HTONUL(data);  /* [RPAP - Jan 97: Endian Ordering] */
    152       fwrite (&data, sizeof (u_long), 1, idx[MERGE]);
     152      fwrite (&data, sizeof (mg_u_long), 1, idx[MERGE]);
    153153    }
    154   /* write last u_long in idx[MERGE] (= length of file) */
    155   fread (&data, sizeof (u_long), 1, idx[NEW]);
     154  /* write last mg_u_long in idx[MERGE] (= length of file) */
     155  fread (&data, sizeof (mg_u_long), 1, idx[NEW]);
    156156  NTOHUL(data);  /* [RPAP - Jan 97: Endian Ordering] */
    157157  data += offset;
    158158  HTONUL(data);  /* [RPAP - Jan 97: Endian Ordering] */
    159   fwrite (&data, sizeof (u_long), 1, idx[MERGE]);
     159  fwrite (&data, sizeof (mg_u_long), 1, idx[MERGE]);
    160160
    161161/******* update .text *******/
     
    188188  fclose (idx[NEW]);
    189189
    190   fprintf (stderr, "mg_text_merge: %ld documents added to %s\n",
     190  fprintf (stderr, "mg_text_merge: %d documents added to %s\n",
    191191       cth[NEW].num_of_docs, merge_name);
    192192
  • main/trunk/greenstone2/common-src/indexers/mg/src/text/mg_weights_build.c

    r16583 r25147  
    3838#include "words.h"
    3939
    40 #define MAXBITS (sizeof(unsigned long) * 8)
     40#define MAXBITS (sizeof(mg_u_long) * 8)
    4141
    4242/*
     
    8181static char *file_name = "";
    8282static char *text_file_name = "";
    83 static unsigned long NumPara = 0;
    84 static unsigned long StaticNumOfDocs = 0;
    85 
    86 unsigned long get_NumPara (void);
    87 unsigned long get_StaticNumOfDocs (void);
     83static mg_u_long NumPara = 0;
     84static mg_u_long StaticNumOfDocs = 0;
     85
     86mg_u_long get_NumPara (void);
     87mg_u_long get_StaticNumOfDocs (void);
    8888void GenerateWeights (void);
    8989void Make_weight_approx (void);
     
    141141
    142142
    143 unsigned long
     143mg_u_long
    144144get_NumPara (void)
    145145{
     
    158158
    159159
    160 unsigned long
     160mg_u_long
    161161get_StaticNumOfDocs (void)
    162162/* the static number of documents is the N parameter used to
     
    253253    {
    254254      u_char dummy1, dummy2[MAXSTEMLEN + 1];
    255       unsigned long fcnt, wcnt, blk, CurrDoc, p, j;
     255      mg_u_long fcnt, wcnt, blk, CurrDoc, p, j;
    256256      float idf;
    257257
     
    281281      /* check the inverted file index entry for this word */
    282282      {
    283     unsigned long loc;
     283    mg_u_long loc;
    284284    fread ((char *) &loc, sizeof (loc), 1, idx);
    285285    NTOHUL(loc);  /* [RPAP - Jan 97: Endian Ordering] */
     
    292292      for (j = 0; j < p; j++)
    293293    {
    294       unsigned long x, tf;
     294      mg_u_long x, tf;
    295295      BBLOCK_DECODE (x, blk);
    296296      CurrDoc += x;
     
    346346{
    347347  int i, pos, max;
    348   unsigned long buf;
     348  mg_u_long buf;
    349349  double U, L, B;
    350350  FILE *approx, *exact;
     
    368368
    369369    }
    370   fseek (exact, sizeof (u_long), SEEK_SET);
     370  fseek (exact, sizeof (mg_u_long), SEEK_SET);
    371371
    372372  B = pow (U / L, pow (2.0, -(double) bits));
     
    392392  for (buf = pos = i = 0; i < NumPara; i++)
    393393    {
    394       unsigned long fx;
     394      mg_u_long fx;
    395395      float wgt;
    396396      fread ((char *) &wgt, sizeof (wgt), 1, exact);
     
    476476    struct
    477477      {
    478     unsigned long Start;
     478    mg_u_long Start;
    479479    float Weight;
    480480      }
     
    483483      {
    484484    int count;
    485     fread ((char *) &data.Start, sizeof (unsigned long), 1, idx);
     485    fread ((char *) &data.Start, sizeof (mg_u_long), 1, idx);
    486486    if (para && i < cth.num_of_docs)
    487487      {
     
    502502      }
    503503    /* Write out the extra entry for the idx file */
    504     fread ((char *) &data.Start, sizeof (unsigned long), 1, idx);
     504    fread ((char *) &data.Start, sizeof (mg_u_long), 1, idx);
    505505    data.Weight = 0;
    506506    fwrite((char*)&data, sizeof(data), 1, idx_wgt);
  • main/trunk/greenstone2/common-src/indexers/mg/src/text/mgdictlist.c

    r16583 r25147  
    7373int quick = 0;
    7474int no_of_words[2];
    75 u_long maxcodelen[2];
     75mg_u_long maxcodelen[2];
    7676
    7777char *dictname = "";
     
    102102
    103103  if (quick)
    104     printf ("%ld\n", idh.dict_size);
     104    printf ("%d\n", idh.dict_size);
    105105  else
    106106    {
    107       printf ("# lookback           = %lu\n", idh.lookback);
    108       printf ("# dict size          = %lu\n", idh.dict_size);
    109       printf ("# total bytes        = %lu\n", idh.total_bytes);
    110       printf ("# index string bytes = %lu\n", idh.index_string_bytes);
     107      printf ("# lookback           = %u\n", idh.lookback);
     108      printf ("# dict size          = %u\n", idh.dict_size);
     109      printf ("# total bytes        = %u\n", idh.total_bytes);
     110      printf ("# index string bytes = %u\n", idh.index_string_bytes);
    111111      printf ("# input bytes        = %.0f\n", idh.input_bytes); /* [RJM 07/97: 4G limit] */
    112       printf ("# num of docs        = %lu\n", idh.num_of_docs);
    113       printf ("# static num of docs = %lu\n", idh.static_num_of_docs);
    114       printf ("# num of words       = %lu\n", idh.num_of_words);
     112      printf ("# num of docs        = %u\n", idh.num_of_docs);
     113      printf ("# static num of docs = %u\n", idh.static_num_of_docs);
     114      printf ("# num of words       = %u\n", idh.num_of_words);
    115115      printf ("#\n");
    116116    }
     
    118118  for (i = 0; i < idh.dict_size; i++)
    119119    {
    120       register unsigned long copy, suff;
    121       unsigned long wcnt, fcnt;
     120      register mg_u_long copy, suff;
     121      mg_u_long wcnt, fcnt;
    122122
    123123      /* build a new word on top of prev */
     
    137137      if (!quick)
    138138    {
    139       printf ("%d: %8ld ", i, wcnt);
    140       printf ("/ %5ld ", fcnt);
    141       printf ("%2d %2ld\t\"", *prev, copy);
     139      printf ("%d: %8d ", i, wcnt);
     140      printf ("/ %5d ", fcnt);
     141      printf ("%2d %2d\t\"", *prev, copy);
    142142    }
    143143      printf ("%s", word2str (prev));
    144144      if (quick)
    145     printf (" %ld %ld\n", wcnt, fcnt);
     145    printf (" %d %d\n", wcnt, fcnt);
    146146      else
    147147    {
     
    159159{
    160160  comp_frags_header cfh;
    161   u_long *codes;
     161  mg_u_long *codes;
    162162  u_char prev[MAXSTEMLEN + 1];
    163163  int i;
     
    168168  printf ("#\n");
    169169  printf ("#   max code len       = %u\n", cfh.hd.maxcodelen);
    170   printf ("#   total bytes        = %lu\n", cfh.uncompressed_size);
     170  printf ("#   total bytes        = %d\n", cfh.uncompressed_size);
    171171  printf ("#\n");
    172172
     
    202202  int i;
    203203  huff_data hd;
    204   u_long *codes;
     204  mg_u_long *codes;
    205205
    206206  if (Read_Huffman_Data (f, &hd, NULL, NULL) == -1)
     
    232232  int i;
    233233  huff_data hd;
    234   u_long *codes;
     234  mg_u_long *codes;
    235235
    236236  if (Read_Huffman_Data (f, &hd, NULL, NULL) == -1)
     
    280280      break;
    281281    }
    282   printf ("# num words          = %lu\n", cdh.num_words[1]);
    283   printf ("# num word chars     = %lu\n", cdh.num_word_chars[1]);
    284   printf ("# num non-words      = %lu\n", cdh.num_words[0]);
    285   printf ("# num non-word chars = %lu\n", cdh.num_word_chars[0]);
    286   printf ("# lookback           = %lu\n", cdh.lookback);
     282  printf ("# num words          = %d\n", cdh.num_words[1]);
     283  printf ("# num word chars     = %d\n", cdh.num_word_chars[1]);
     284  printf ("# num non-words      = %d\n", cdh.num_words[0]);
     285  printf ("# num non-word chars = %d\n", cdh.num_word_chars[0]);
     286  printf ("# lookback           = %d\n", cdh.lookback);
    287287
    288288  for (which = 0; which < 2; which++)
     
    338338
    339339      if (!quick)
    340     printf ("#\n# num %9s      = %lu\n#\n", i ? "words" : "non-words",
     340    printf ("#\n# num %9s      = %u\n#\n", i ? "words" : "non-words",
    341341        fsh.num_frags);
    342342
     
    344344    {
    345345      u_char Word[16];
    346       u_long freq, occur_num;
     346      mg_u_long freq, occur_num;
    347347
    348348      fread (&freq, sizeof (freq), 1, f);
     
    355355      Word[0] = fgetc (f);
    356356      fread (Word + 1, Word[0], 1, f);
    357       printf ("%d: %7ld : %7ld : \"%s\"\n", j, freq,
     357      printf ("%d: %7d : %7d : \"%s\"\n", j, freq,
    358358          occur_num, word2str (Word));
    359359    }
     
    365365{
    366366  FILE *fp;
    367   unsigned long magic = 0;
     367  mg_u_long magic = 0;
    368368
    369369  if (argc < 2)
  • main/trunk/greenstone2/common-src/indexers/mg/src/text/mgpass.c

    r16583 r25147  
    100100#define path_length 256
    101101
    102 unsigned long buf_size = 3 * 1024 * 1024;       /* 3Mb */
    103 unsigned long invf_buffer_size = 5 * 1024 * 1024;       /* 5Mb */
    104 unsigned long ChunkLimit = 0;
     102mg_u_long buf_size = 3 * 1024 * 1024;       /* 3Mb */
     103mg_u_long invf_buffer_size = 5 * 1024 * 1024;       /* 5Mb */
     104mg_u_long ChunkLimit = 0;
    105105char InvfLevel = 2;
    106106char SkipSGML = 0;
     
    115115
    116116static char Passes = 0;
    117 static unsigned long trace = 0;
     117static mg_u_long trace = 0;
    118118static int Dump = 0;
    119119static char **files = NULL;
     
    237237void search(char *dname, char *fname)
    238238{
    239   long dirtag;  struct _finddata_t dirinfo;  int in_fd;  char *res;
     239  mg_s_long dirtag;  struct _finddata_t dirinfo;  int in_fd;  char *res;
    240240  char search_name[path_length], found_name[path_length];
    241241
     
    433433      break;
    434434    case 't':
    435       trace = (unsigned long) (atof (optarg) * 1024 * 1024);
     435      trace = (mg_u_long) (atof (optarg) * 1024 * 1024);
    436436      break;
    437437    case 'h':
  • main/trunk/greenstone2/common-src/indexers/mg/src/text/mgquery.c

    r16583 r25147  
    143143#ifdef TREC_MODE
    144144char *trec_ids = NULL;
    145 long *trec_paras = NULL;
     145mg_s_long *trec_paras = NULL;
    146146#endif
    147147
     
    264264
    265265#ifdef USE_PROCESS_MEM
    266 static u_long
     266static mg_u_long
    267267process_mem (void)
    268268{
     
    272272    {
    273273      char buf[128];
    274       sprintf (buf, "/proc/%ld", (long) getpid ());
     274      sprintf (buf, "/proc/%d", (mg_s_long) getpid ());
    275275      fd = open (buf, O_RDONLY);
    276276    }
     
    347347StatFile (File * F)
    348348{
    349   static unsigned long NumBytes = 0, NumSeeks = 0, NumReads = 0;
     349  static mg_u_long NumBytes = 0, NumSeeks = 0, NumReads = 0;
    350350  if (F)
    351351    {
    352       if ((int) F != -1)
     352      if ((intptr_t) F != -1)
    353353    {
    354354      if (!BooleanEnv (GetEnv ("briefstats"), 0))
     
    533533/* num should be greater than or equal to 1 */
    534534int
    535 RawDocOutput (query_data * qd, u_long num, FILE * Output)
    536 {
    537   static u_long last_pos = 0;
     535RawDocOutput (query_data * qd, mg_u_long num, FILE * Output)
     536{
     537  static mg_u_long last_pos = 0;
    538538  static u_char *c_buffer = 0;
    539539  static int buf_len = -1;
    540540  static u_char *uc_buffer = 0;
    541   u_long pos, len;
     541  mg_u_long pos, len;
    542542  int ULen;
    543543
     
    570570void
    571571StringOut (FILE * Output, char *string,
    572        int intvalid, unsigned long intval,
     572       int intvalid, mg_u_long intval,
    573573       int floatvalid, double floatval)
    574574{
     
    583583      case 'n':
    584584        if (intvalid)
    585           fprintf (Output, "%lu", intval);
     585          fprintf (Output, "%d", intval);
    586586        else
    587587          fprintf (Output, "%%n");
     
    603603
    604604void
    605 HeaderOut (FILE * Output, u_char * UDoc, unsigned long ULen, int heads_length)
     605HeaderOut (FILE * Output, u_char * UDoc, mg_u_long ULen, int heads_length)
    606606{
    607607  int i, space = 1, num = 0;
     
    688688    {
    689689      u_char *UDoc = NULL;
    690       unsigned long ULen;
     690      mg_u_long ULen;
    691691
    692692      if (need_text)
     
    760760            }
    761761#else
    762         fprintf (Output, "%7d   %6.4f   %7lu\n", GetDocNum (qd),
     762        fprintf (Output, "%7d   %6.4f   %7u\n", GetDocNum (qd),
    763763             GetDocWeight (qd), GetDocCompLength (qd));
    764764#endif
     
    776776          if (PagerRunning && trec_ids)
    777777        {
    778           long DN, PN = GetDocNum (qd) - 1;
     778          mg_s_long DN, PN = GetDocNum (qd) - 1;
    779779          if (trec_paras)
    780780            DN = trec_paras[PN];
    781781          else
    782782            DN = PN;
    783           fprintf (Output, "%-14.14s  %8ld  %10.5f\n",
     783          fprintf (Output, "%-14.14s  %8d  %10.5f\n",
    784784               &trec_ids[DN * 14], PN + 1, GetDocWeight (qd));
    785785        }
     
    991991      return;
    992992    }
    993       sprintf (pager, "%s --style=%s --pager=%s --stem_method=%ld --stemmer=%ld %s",
     993      sprintf (pager, "%s --style=%s --pager=%s --stem_method=%d --stemmer=%d %s",
    994994           HILITE_PAGER,
    995995           GetEnv ("hilite_style"),
  • main/trunk/greenstone2/common-src/indexers/mg/src/text/mgstat.c

    r16583 r25147  
    7070void ProcessDict (char *);
    7171void ProcessStem (char *);
    72 long ProcessStemBlk (char *name);  /* [RPAP - Jan 97: Stem Index Change] */
     72mg_s_long ProcessStemBlk (char *name);  /* [RPAP - Jan 97: Stem Index Change] */
    7373
    7474static mg_ullong inputbytes = 0;
     
    8686  int ch;
    8787  int exact = 0;
    88   long indexed = 0; /* [RPAP - Jan 97: Stem Index Change] */
     88  mg_s_long indexed = 0; /* [RPAP - Jan 97: Stem Index Change] */
    8989  opterr = 0;
    9090  while ((ch = getopt (argc, argv, "Ehf:d:")) != -1)
     
    258258    {
    259259      inputbytes = cth.num_of_bytes;
    260       printf ("Input bytes                        : %10" ULL_FS ", %8.2f Mbyte\n",
     260      printf ("Input bytes                        : %10f, %8.2f Mbyte\n",
    261261          cth.num_of_bytes, (double) cth.num_of_bytes / 1024 / 1024);
    262       printf ("Documents                          : %10lu\n", cth.num_of_docs);
    263       printf ("Words in collection [dict]         : %10lu\n", cth.num_of_words);
    264       printf ("Longest doc in collection [dict]   : %10lu characters\n",
     262      printf ("Documents                          : %10d\n", cth.num_of_docs);
     263      printf ("Words in collection [dict]         : %10d\n", cth.num_of_words);
     264      printf ("Longest doc in collection [dict]   : %10d characters\n",
    265265          cth.length_of_longest_doc);
    266266      printf ("Maximum ratio                      : %10.2f\n", cth.ratio);
     
    269269  if (have_cdh)
    270270    {
    271       printf ("Words in dict                      : %10lu\n", cdh.num_words[1]);
    272       printf ("Non-words in dict                  : %10lu\n", cdh.num_words[0]);
    273       printf ("Total chars of distinct words      : %10lu\n", cdh.num_word_chars[1]);
    274       printf ("Total chars of distinct non-words  : %10lu\n", cdh.num_word_chars[0]);
     271      printf ("Words in dict                      : %10d\n", cdh.num_words[1]);
     272      printf ("Non-words in dict                  : %10d\n", cdh.num_words[0]);
     273      printf ("Total chars of distinct words      : %10d\n", cdh.num_word_chars[1]);
     274      printf ("Total chars of distinct non-words  : %10d\n", cdh.num_word_chars[0]);
    275275    }
    276276
     
    294294    return;
    295295  fread ((char *) &idh, sizeof (idh), 1, f);
    296   printf ("Words in collection [stem]         : %10ld\n", NTOHUL(idh.num_of_words));  /* [RPAP - Jan 97: Endian Ordering] */
    297   printf ("Words in stem                      : %10ld\n", NTOHUL(idh.dict_size));  /* [RPAP - Jan 97: Endian Ordering] */
    298   printf ("Indexed fragments                  : %10ld\n", NTOHUL(idh.num_of_docs));  /* [RPAP - Jan 97: Endian Ordering] */
    299   printf ("Total chars of stem words          : %10ld\n", NTOHUL(idh.total_bytes));  /* [RPAP - Jan 97: Endian Ordering] */
     296  printf ("Words in collection [stem]         : %10d\n", NTOHUL(idh.num_of_words));  /* [RPAP - Jan 97: Endian Ordering] */
     297  printf ("Words in stem                      : %10d\n", NTOHUL(idh.dict_size));  /* [RPAP - Jan 97: Endian Ordering] */
     298  printf ("Indexed fragments                  : %10d\n", NTOHUL(idh.num_of_docs));  /* [RPAP - Jan 97: Endian Ordering] */
     299  printf ("Total chars of stem words          : %10d\n", NTOHUL(idh.total_bytes));  /* [RPAP - Jan 97: Endian Ordering] */
    300300  fclose (f);
    301301}
     
    306306
    307307/* [RPAP - Jan 97: Stem Index Change] */
    308 long
     308mg_s_long
    309309ProcessStemBlk (char *name)
    310310{
  • main/trunk/greenstone2/common-src/indexers/mg/src/text/mgstemidxlist.c

    r16583 r25147  
    3636read_3_in_4 (FILE * idbi)
    3737{
    38   unsigned long i;
     38  mg_u_long i;
    3939  stemmed_idx *si;
    4040  u_char *buffer;
     
    106106    }
    107107
    108   printf ("# lookback     = %lu\n", si->sih.lookback);
    109   printf ("# block_size   = %lu\n", si->sih.block_size);
    110   printf ("# num_blocks   = %lu\n", si->sih.num_blocks);
    111   printf ("# blocks_start = %lu\n", si->sih.blocks_start);
    112   printf ("# index_chars  = %lu\n", si->sih.index_chars);
    113   printf ("# num_of_words = %lu\n", si->sih.num_of_words);
     108  printf ("# lookback     = %u\n", si->sih.lookback);
     109  printf ("# block_size   = %u\n", si->sih.block_size);
     110  printf ("# num_blocks   = %u\n", si->sih.num_blocks);
     111  printf ("# blocks_start = %u\n", si->sih.blocks_start);
     112  printf ("# index_chars  = %u\n", si->sih.index_chars);
     113  printf ("# num_of_words = %u\n", si->sih.num_of_words);
    114114
    115115  block = 0;
    116116  while (block < si->sih.num_blocks)
    117117    {
    118       unsigned long *first_word;
     118      mg_u_long *first_word;
    119119      unsigned short *num_words;
    120120      unsigned short *index;
    121       long res;
     121      mg_s_long res;
    122122      u_char *base;
    123123      int num_indexes;
     
    128128      si->active = si->pos[block];
    129129
    130       first_word = (unsigned long *) (si->buffer);
     130      first_word = (mg_u_long *) (si->buffer);
    131131      NTOHUL(*first_word);  /* [RPAP - Jan 97: Endian Ordering] */
    132132      num_words = (unsigned short *) (first_word + 1);
     
    143143
    144144      printf ("\n# block      = %d\n", block);
    145       printf ("# first_word = %lu\n", *first_word);
     145      printf ("# first_word = %u\n", *first_word);
    146146      printf ("# num_words  = %u\n", *num_words);
    147147
  • main/trunk/greenstone2/common-src/indexers/mg/src/text/query.docnums.c

    r16583 r25147  
    6464{
    6565  DocList *Docs = MakeDocList (0);
    66   unsigned long start = 0, finish;
     66  mg_u_long start = 0, finish;
    6767  int range = 0; /* is there a range or not ? */
    6868
     
    7575      finish <= qd->sd->sdh.num_of_docs)
    7676    {
    77       unsigned long i;
     77      mg_u_long i;
    7878      if (!range)
    7979        start = finish;
  • main/trunk/greenstone2/common-src/indexers/mg/src/text/query.ranked.c

    r16583 r25147  
    8989    float *OrgWeight;
    9090    int DocNum;
    91     u_long SeekPos;     /* position in the text file in bytes */
    92     u_long Len;         /* length of the document in bytes */
     91    mg_u_long SeekPos;      /* position in the text file in bytes */
     92    mg_u_long Len;          /* length of the document in bytes */
    9393  }
    9494HeapEntry;
     
    290290    {
    291291      int j;
    292       long num_entries, word_num;
    293       unsigned long count, doc_count, invf_ptr, invf_len;
     292      mg_s_long num_entries, word_num;
     293      mg_u_long count, doc_count, invf_ptr, invf_len;
    294294      int weight_to_apply, stem_to_apply;
    295295      int method_using = -1;
     
    408408        {
    409409          int i;
    410           u_long max_doc_count = 0;
     410          mg_u_long max_doc_count = 0;
    411411
    412412          /* get the maximum doc count */
     
    748748        for (i = 0; i < ST->no_of_items; i++, ide = SP_get_next (ST))
    749749          {
    750         u_long SeekPos, Len;
     750        mg_u_long SeekPos, Len;
    751751        float Weight;
    752752        if (!ide->Sum)
     
    777777        for (i = 0; i < qd->sd->sdh.num_of_docs; i++, fptr++)
    778778          {
    779         u_long SeekPos, Len;
     779        mg_u_long SeekPos, Len;
    780780        float Weight;
    781781        if (!*fptr)
     
    803803        for (ideh = HT->Head; ideh; ideh = ideh->next)
    804804          {
    805         u_long SeekPos, Len;
     805        mg_u_long SeekPos, Len;
    806806        float Weight;
    807807        if (!ideh->IDE.Sum)
     
    829829        for (i = 0; i < LT->num; i++, ide++)
    830830          {
    831         u_long SeekPos, Len;
     831        mg_u_long SeekPos, Len;
    832832        float Weight;
    833833        if (!ide->Sum)
  • main/trunk/greenstone2/common-src/indexers/mg/src/text/stem_search.c

    r16583 r25147  
    8383ReadStemDictBlk (File * stem_file)
    8484{
    85   unsigned long i;
     85  mg_u_long i;
    8686  stemmed_dict *sd;
    8787  u_char *buffer;
     
    173173ReadStemIdxBlk (File * stem_idx_file)
    174174{
    175   unsigned long i;
     175  mg_u_long i;
    176176  stemmed_idx *si;
    177177  u_char *buffer;
     
    300300 * This function looks up a word in the stemmed dictionary, it returns -1
    301301 * if the word cound not be found, and 0 if it successfully finds the word.
    302  * If count is non-null the ulong it is pointing to is set to the number of
     302 * If count is non-null the unsigned it is pointing to is set to the number of
    303303 * occurances of the stemmed word in the collection. i.e wcnt.
    304  * If doc_count is non-null the ulong it is pointing to is set to the number
     304 * If doc_count is non-null the unsigned it is pointing to is set to the number
    305305 * of documents that the word occurs in. i.e fcnt
    306  * If invf_ptr is non-null the ulong it is pointing to is set to the position
     306 * If invf_ptr is non-null the unsigned it is pointing to is set to the position
    307307 * of the inverted file where the entry for this word start.
    308308 */
    309309int
    310 FindWord (stemmed_dict * sd, u_char * Word, unsigned long *count,
    311       unsigned long *doc_count, unsigned long *invf_ptr,
    312       unsigned long *invf_len)
     310FindWord (stemmed_dict * sd, u_char * Word, mg_u_long *count,
     311      mg_u_long *doc_count, mg_u_long *invf_ptr,
     312      mg_u_long *invf_len)
    313313{
    314314  register int lo, hi, mid, c;
    315315  register unsigned int res;
    316316  int block, num_indexes;
    317   unsigned long *first_word, *last_invf_len;
     317  mg_u_long *first_word, *last_invf_len;
    318318  unsigned short *num_words;
    319319  u_char *base;
     
    332332
    333333      /* [RPAP - Jan 97: Endian Ordering] */
    334       first_word = (unsigned long *) (sd->buffer);
     334      first_word = (mg_u_long *) (sd->buffer);
    335335      NTOHUL(*first_word);
    336       last_invf_len = (unsigned long *) (first_word + 1);
     336      last_invf_len = (mg_u_long *) (first_word + 1);
    337337      NTOHUL(*last_invf_len);
    338338      num_words = (unsigned short *) (last_invf_len + 1);
     
    346346  else
    347347    {
    348       first_word = (unsigned long *) (sd->buffer);
    349       last_invf_len = (unsigned long *) (first_word + 1);
     348      first_word = (mg_u_long *) (sd->buffer);
     349      last_invf_len = (mg_u_long *) (first_word + 1);
    350350      num_words = (unsigned short *) (last_invf_len + 1);
    351351      index = num_words + 1;
     
    379379    {
    380380      unsigned copy, suff;
    381       unsigned long invfp;
     381      mg_u_long invfp;
    382382      if (res >= *num_words)
    383383    return (-1);
     
    417417    {
    418418      /* Calculate invf_len is necessary */
    419       unsigned long next_invfp;
     419      mg_u_long next_invfp;
    420420      if (!invf_len)
    421421        return (*first_word + res);
     
    432432      base++;
    433433      suff = *base++;
    434       base += suff + sizeof (unsigned long) * 2;
     434      base += suff + sizeof (mg_u_long) * 2;
    435435      bcopy ((char *) base, (char *) &next_invfp, sizeof (next_invfp));
    436436      NTOHUL(next_invfp);  /* [RPAP - Jan 97: Endian Ordering] */
     
    453453
    454454  int block, num_indexes;
    455   unsigned long *first_word, *last_invf_len;
     455  mg_u_long *first_word, *last_invf_len;
    456456  unsigned short *num_words;
    457457  u_char *base;
     
    460460
    461461  int idx_block, idx_num_indexes;
    462   unsigned long *idx_first_word;
     462  mg_u_long *idx_first_word;
    463463  unsigned short *idx_num_words;
    464464  u_char *idx_base;
     
    512512      si->active = si->pos[idx_block];
    513513
    514       idx_first_word = (unsigned long *) (si->buffer);
     514      idx_first_word = (mg_u_long *) (si->buffer);
    515515      NTOHUL(*idx_first_word);  /* [RPAP - Jan 97: Endian Ordering] */
    516516      idx_num_words = (unsigned short *) (idx_first_word + 1);
     
    525525  else
    526526    {
    527       idx_first_word = (unsigned long *) (si->buffer);
     527      idx_first_word = (mg_u_long *) (si->buffer);
    528528      idx_num_words = (unsigned short *) (idx_first_word + 1);
    529529      idx_index = idx_num_words + 1;
     
    591591    {
    592592      unsigned copy, suff;
    593       unsigned long invfp;
     593      mg_u_long invfp;
    594594      /* Read next stem index pos */
    595595      bcopy ((char *) idx_base, (char *) &num_cases, sizeof (num_cases));
     
    613613      sd->active = sd->pos[block];
    614614
    615       first_word = (unsigned long *) (sd->buffer);
     615      first_word = (mg_u_long *) (sd->buffer);
    616616      NTOHUL(*first_word);  /* [RPAP - Jan 97: Endian Ordering] */
    617       last_invf_len = (unsigned long *) (first_word + 1);
     617      last_invf_len = (mg_u_long *) (first_word + 1);
    618618      NTOHUL(*last_invf_len);  /* [RPAP - Jan 97: Endian Ordering] */
    619619      num_words = (unsigned short *) (last_invf_len + 1);
     
    628628      else
    629629    {
    630       first_word = (unsigned long *) (sd->buffer);
    631       last_invf_len = (unsigned long *) (first_word + 1);
     630      first_word = (mg_u_long *) (sd->buffer);
     631      last_invf_len = (mg_u_long *) (first_word + 1);
    632632      num_words = (unsigned short *) (last_invf_len + 1);
    633633      index = num_words + 1;
     
    646646      base += suff;
    647647      *prev = copy + suff;
    648       base += sizeof (unsigned long);   /* skip doc_count */
    649       base += sizeof (unsigned long);   /* skip count */
    650       base += sizeof (unsigned long);   /* skip invf_ptr */
     648      base += sizeof (mg_u_long);   /* skip doc_count */
     649      base += sizeof (mg_u_long);   /* skip count */
     650      base += sizeof (mg_u_long);   /* skip invf_ptr */
    651651      res++;
    652652    }
     
    694694      else
    695695        {
    696           unsigned long next_invfp;
     696          mg_u_long next_invfp;
    697697          u_char *oldbase = base;
    698698         
     
    700700          base++;
    701701          suff = *base++;
    702           base += suff + sizeof (unsigned long) * 2;
     702          base += suff + sizeof (mg_u_long) * 2;
    703703          bcopy ((char *) base, (char *) &next_invfp, sizeof (next_invfp));
    704704          NTOHUL(next_invfp);  /* [RPAP - Jan 97: Endian Ordering] */
     
    720720          sd->active = sd->pos[block];
    721721
    722           first_word = (unsigned long *) (sd->buffer);
     722          first_word = (mg_u_long *) (sd->buffer);
    723723          NTOHUL(*first_word);  /* [RPAP - Jan 97: Endian Ordering] */
    724           last_invf_len = (unsigned long *) (first_word + 1);
     724          last_invf_len = (mg_u_long *) (first_word + 1);
    725725          NTOHUL(*last_invf_len);  /* [RPAP - Jan 97: Endian Ordering] */
    726726          num_words = (unsigned short *) (last_invf_len + 1);
  • main/trunk/greenstone2/common-src/indexers/mg/src/text/stem_search.h

    r16583 r25147  
    2929stemmed_idx *ReadStemIdxBlk (File * stem_idx_file);
    3030
    31 int FindWord (stemmed_dict * sd, u_char * Word, unsigned long *count,
    32           unsigned long *doc_count, unsigned long *invf_ptr,
    33           unsigned long *invf_len);
     31int FindWord (stemmed_dict * sd, u_char * Word, mg_u_long *count,
     32          mg_u_long *doc_count, mg_u_long *invf_ptr,
     33          mg_u_long *invf_len);
    3434
    3535/* [RPAP - Jan 97: Stem Index Change] */
  • main/trunk/greenstone2/common-src/indexers/mg/src/text/term_lists.c

    r16583 r25147  
    200200int
    201201AddTerm (TermList ** query_term_list, u_char * Word, int Count, int word_num,
    202      u_long count, u_long doc_count, u_long invf_ptr, u_long invf_len, int stemmer_num)  /* [RPAP - Feb 97: Term Frequency] */
     202     mg_u_long count, mg_u_long doc_count, mg_u_long invf_ptr, mg_u_long invf_len, int stemmer_num)  /* [RPAP - Feb 97: Term Frequency] */
    203203{
    204204  int j;
     
    283283{
    284284  fprintf (file, "we->word_num = %d\n", we->word_num);
    285   fprintf (file, "we->count = %ld\n", we->count);
    286   fprintf (file, "we->doc_count = %ld\n", we->doc_count);
    287   fprintf (file, "we->max_doc_count = %ld\n", we->max_doc_count);
    288   fprintf (file, "we->invf_ptr = %ld\n", we->invf_ptr);
    289   fprintf (file, "we->invf_len = %ld\n", we->invf_len);
     285  fprintf (file, "we->count = %d\n", we->count);
     286  fprintf (file, "we->doc_count = %d\n", we->doc_count);
     287  fprintf (file, "we->max_doc_count = %d\n", we->max_doc_count);
     288  fprintf (file, "we->invf_ptr = %d\n", we->invf_ptr);
     289  fprintf (file, "we->invf_len = %d\n", we->invf_len);
    290290}
    291291
  • main/trunk/greenstone2/common-src/indexers/mg/src/text/term_lists.h

    r16583 r25147  
    5959  {
    6060    int word_num;       /* Unique number for each different word */
    61     u_long count;       /* Number of times the word occurs in the text */
    62     u_long doc_count;       /* Number of documents that contain the word */
    63     u_long max_doc_count;       /* [RPAP - Jan 97: Stem Index Change] */
    64     u_long invf_ptr;        /* This is a byte position of the 
     61    mg_u_long count;        /* Number of times the word occurs in the text */
     62    mg_u_long doc_count;        /* Number of documents that contain the word */
     63    mg_u_long max_doc_count;       /* [RPAP - Jan 97: Stem Index Change] */
     64    mg_u_long invf_ptr;     /* This is a byte position of the 
    6565                   inverted file entry corresponding to the word */
    66     u_long invf_len;        /* This is the length of the inverted
     66    mg_u_long invf_len;     /* This is the length of the inverted
    6767                   file entry in bytes */
    6868  }
     
    9393int AddTermEntry (TermList ** query_term_list, TermEntry * te);
    9494int AddTerm (TermList ** query_term_list, u_char * Word, int Count, int word_num,
    95          u_long count, u_long doc_count, u_long invf_ptr, u_long invf_len, /* [RPAP - Feb 97: Term Frequency] */
     95         mg_u_long count, mg_u_long doc_count, mg_u_long invf_ptr, mg_u_long invf_len, /* [RPAP - Feb 97: Term Frequency] */
    9696         int stemmer_num); 
    9797void ResetTermList (TermList ** tl);
  • main/trunk/greenstone2/common-src/indexers/mg/src/text/text.h

    r16583 r25147  
    117117typedef struct compression_dict_header
    118118  {
    119     u_long dict_type;
    120     u_long novel_method;
    121     u_long params[TEXT_PARAMS];
    122     u_long num_words[2];
    123     u_long num_word_chars[2];
    124     u_long lookback;
     119    mg_u_long dict_type;
     120    mg_u_long novel_method;
     121    mg_u_long params[TEXT_PARAMS];
     122    mg_u_long num_words[2];
     123    mg_u_long num_word_chars[2];
     124    mg_u_long lookback;
    125125  }
    126126compression_dict_header;
     
    130130  {
    131131    huff_data hd;
    132     u_long uncompressed_size;
    133     u_long huff_words_size[MAX_HUFFCODE_LEN + 1];
     132    mg_u_long uncompressed_size;
     133    mg_u_long huff_words_size[MAX_HUFFCODE_LEN + 1];
    134134  }
    135135comp_frags_header;
     
    139139typedef struct compressed_text_header
    140140  {
    141     u_long num_of_docs;
    142     u_long num_of_words;    /* number of words in collection */
     141    mg_u_long num_of_docs;
     142    mg_u_long num_of_words; /* number of words in collection */
    143143    double num_of_bytes; /* [RJM 07/97: 4G limit] */
    144144    double ratio;
    145     u_long length_of_longest_doc;   /* (characters) */
    146     u_long dummy;    /* added to make the structure the same on different architectures */
     145    mg_u_long length_of_longest_doc;    /* (characters) */
     146    mg_u_long dummy;    /* added to make the structure the same on different architectures */
    147147  }
    148148compressed_text_header;
     
    151151typedef struct compression_stats_header
    152152  {
    153     u_long num_docs;
    154     u_long dummy;   /* added to make the structure the same on different architectures */
     153    mg_u_long num_docs;
     154    mg_u_long dummy;   /* added to make the structure the same on different architectures */
    155155    double num_bytes; /* [RJM 07/97: 4G limit] */
    156156  }
     
    160160typedef struct frags_stats_header
    161161  {
    162     u_long num_frags;
    163     u_long mem_for_frags;
     162    mg_u_long num_frags;
     163    mg_u_long mem_for_frags;
    164164  }
    165165frags_stats_header;
     
    168168typedef struct aux_frags_header
    169169  {
    170     u_long num_frags;
    171     u_long mem_for_frags;
     170    mg_u_long num_frags;
     171    mg_u_long mem_for_frags;
    172172  }
    173173aux_frags_header;
  • main/trunk/greenstone2/common-src/indexers/mg/src/text/text.pass1.c

    r16583 r25147  
    5050typedef struct hash_rec
    5151  {
    52     unsigned long wcnt;     /* word frequency */
    53     unsigned long occurance_num;
     52    mg_u_long wcnt;     /* word frequency */
     53    mg_u_long occurance_num;
    5454    u_char *word;
    5555  }
     
    5959  {
    6060    hash_rec *HashTable;
    61     unsigned long HashSize;
    62     unsigned long HashUsed;
    63     unsigned long wordnum;
    64     unsigned long words_read;
    65     unsigned long bytes_diff;
     61    mg_u_long HashSize;
     62    mg_u_long HashUsed;
     63    mg_u_long wordnum;
     64    mg_u_long words_read;
     65    mg_u_long bytes_diff;
    6666    huff_data hd;
    6767  }
     
    7070
    7171
    72 static unsigned long LongestDoc = 0;
    73 static unsigned long occurance_num = 0;
     72static mg_u_long LongestDoc = 0;
     73static mg_u_long occurance_num = 0;
    7474static dict_data DictData[2];
    7575
     
    7777static int PoolLeft;
    7878static double inputbytes = 0; /* [RJM 07/97: 4G limit] */
    79 static unsigned long MaxMemInUse = 0;
    80 static unsigned long MemInUse = 0;
     79static mg_u_long MaxMemInUse = 0;
     80static mg_u_long MemInUse = 0;
    8181static compression_stats_header csh =
    8282{0, 0.0}; /* [RJM 07/97: 4G limit] */
     
    131131    register u_char *wptr;
    132132    register int hsize = dd->HashSize;
    133     register unsigned long hashval, step;
     133    register mg_u_long hashval, step;
    134134
    135135    HASH (hashval, step, word, hsize);
     
    189189      /* Search the hash table for Word */
    190190      {
    191     register unsigned long hashval, step;
     191    register mg_u_long hashval, step;
    192192    register int hsize = dd->HashSize;
    193193    HASH (hashval, step, Word, hsize);
     
    248248    {
    249249      hash_rec *ht;
    250       unsigned long size;
    251       unsigned long i;
     250      mg_u_long size;
     251      mg_u_long i;
    252252      size = prime (dd->HashSize * 2);
    253253      if (!(ht = Xmalloc (sizeof (hash_rec) * size)))
     
    263263          {
    264264        register u_char *wptr;
    265         register unsigned long hashval, step;
     265        register mg_u_long hashval, step;
    266266
    267267        wptr = dd->HashTable[i].word;
     
    325325{
    326326  frags_stats_header fsh;
    327   u_long j = 0;
     327  mg_u_long j = 0;
    328328  u_char *curr;
    329329
  • main/trunk/greenstone2/common-src/indexers/mg/src/text/text.pass2.c

    r16583 r25147  
    8282  {
    8383    struct char_pool *next;
    84     u_long left;
     84    mg_u_long left;
    8585    u_char *ptr;
    8686    u_char pool[POOL_SIZE];
     
    9090typedef struct novel_hash_rec
    9191  {
    92     u_long ordinal_num;
     92    mg_u_long ordinal_num;
    9393    u_char *word;
    9494  }
     
    102102  {
    103103    novel_hash_rec *HashTable;
    104     u_long HashSize, HashUsed;
     104    mg_u_long HashSize, HashUsed;
    105105    char_pool *first_pool;
    106106    char_pool *pool;
    107     u_long next_num, binary_start;
     107    mg_u_long next_num, binary_start;
    108108    novel_hash_rec **code_to_nhr;
    109109  }
     
    115115static u_char *comp_buffer;
    116116
    117 static u_long text_length;
     117static mg_u_long text_length;
    118118
    119119/* [RJM 07/97: 4G limit] */
     
    125125static novel_hash_table nht[2];
    126126
    127 static u_long prefix_len = 0;
     127static mg_u_long prefix_len = 0;
    128128
    129129int blk_start[2][33], blk_end[2][33];
     
    165165    return COMPERROR;
    166166
    167   text_length = sizeof (u_long) + sizeof (cth);
     167  text_length = sizeof (mg_u_long) + sizeof (cth);
    168168
    169169  if (!(text_idx = create_file (file_name, TEXT_IDX_SUFFIX, "w+b",
     
    287287      if (ht[which])
    288288    {
    289       register unsigned long hashval, step;
     289      register mg_u_long hashval, step;
    290290      register int tsize = ht[which]->size;
    291291      register u_char **wptr;
     
    336336      if (cdh.dict_type == MG_PARTIAL_DICTIONARY)
    337337        {
    338           u_long i;
     338          mg_u_long i;
    339339          if (ht[which])
    340340        {
     
    358358        case MG_NOVEL_HUFFMAN_CHARS:
    359359          {
    360             u_long i;
     360            mg_u_long i;
    361361            HUFF_ENCODE (Word[0], lens_codes[which],
    362362                 lens_huff[which].clens);
     
    371371        case MG_NOVEL_HYBRID_MTF:
    372372          {
    373             register unsigned long hashval, step;
     373            register mg_u_long hashval, step;
    374374            register novel_hash_table *h = &nht[which];
    375375            register int hsize = h->HashSize;
     
    481481              {
    482482            novel_hash_rec *ht;
    483             unsigned long size;
    484             unsigned long i;
     483            mg_u_long size;
     484            mg_u_long i;
    485485            size = prime (h->HashSize * 2);
    486486            if (cdh.novel_method == MG_NOVEL_HYBRID_MTF)
     
    501501                {
    502502                  register u_char *wptr;
    503                   register unsigned long hashval, step;
     503                  register mg_u_long hashval, step;
    504504
    505505                  wptr = h->HashTable[i].word;
     
    674674{
    675675  int i;
    676   u_long aux_compressed = 0, total_uncomp = 0;
     676  mg_u_long aux_compressed = 0, total_uncomp = 0;
    677677  for (i = 0; i <= 1; i++)
    678678    {
    679679      int j;
    680       long chars[256], fchars[256];
    681       long lens[16], flens[16];
     680      mg_s_long chars[256], fchars[256];
     681      mg_s_long lens[16], flens[16];
    682682      char_pool *cp;
    683683      bzero ((char *) chars, sizeof (chars));
     
    743743  HTOND(cth.ratio);
    744744
    745   if (fseek (text_idx, sizeof (u_long), SEEK_SET) == -1 ||
     745  if (fseek (text_idx, sizeof (mg_u_long), SEEK_SET) == -1 ||
    746746      fwrite (&cth, sizeof (cth), 1, text_idx) != 1)
    747747    return COMPERROR;
    748748  fclose (text_idx);
    749749
    750   if (fseek (text, sizeof (u_long), SEEK_SET) == -1 ||
     750  if (fseek (text, sizeof (mg_u_long), SEEK_SET) == -1 ||
    751751      fwrite (&cth, sizeof (cth), 1, text) != 1)
    752752    return COMPERROR;
  • main/trunk/greenstone2/common-src/indexers/mg/src/text/text_get.c

    r16583 r25147  
    8484
    8585static double
    86 FetchDocStartLev1 (text_data * td, u_long DN,
    87            u_long * seek_pos, u_long * len)
    88 {
    89   unsigned long data[2];
     86FetchDocStartLev1 (text_data * td, mg_u_long DN,
     87           mg_u_long * seek_pos, mg_u_long * len)
     88{
     89  mg_u_long data[2];
    9090  /* [TS:Sep/94] Fixed up the seek call to give the correct offset */
    9191  Fseek (td->TextIdxFile,
    92      sizeof (unsigned long) * (DN - 1) +    /* the doc offsets */
    93      sizeof (unsigned long) +   /* the magic number */
     92     sizeof (mg_u_long) * (DN - 1) +    /* the doc offsets */
     93     sizeof (mg_u_long) +   /* the magic number */
    9494     sizeof (compressed_text_header),   /* the header */
    9595     0);
     
    108108
    109109static int
    110 LoadIdx (text_data * td, unsigned long DN)
     110LoadIdx (text_data * td, mg_u_long DN)
    111111{
    112112  if (!td->idx_data)
     
    121121      int i, num;  /* [RPAP - Jan 97: Endian Ordering] */
    122122
    123       long rn = (long) DN - (MG_PAGE_SIZE >> 1);
     123      mg_s_long rn = (mg_s_long) DN - (MG_PAGE_SIZE >> 1);
    124124      if (rn < 1)
    125125    rn = 1;
    126       Fseek (td->TextIdxWgtFile, (sizeof (unsigned long) + sizeof (float)) *
    127            (rn - 1) + sizeof (unsigned long), 0);
     126      Fseek (td->TextIdxWgtFile, (sizeof (mg_u_long) + sizeof (float)) *
     127           (rn - 1) + sizeof (mg_u_long), 0);
    128128      num = Fread ((char *) td->idx_data, sizeof (*(td->idx_data)), MG_PAGE_SIZE, /* [RPAP - Jan 97: Endian Ordering] */
    129129           td->TextIdxWgtFile);
     
    142142
    143143static double
    144 FDSL2 (text_data * td, unsigned long DN, unsigned long *Pos)
    145 {
    146   unsigned long pos = LoadIdx (td, DN);
     144FDSL2 (text_data * td, mg_u_long DN, mg_u_long *Pos)
     145{
     146  mg_u_long pos = LoadIdx (td, DN);
    147147  *Pos = td->idx_data[pos].Start;
    148148  return (td->idx_data[pos].Weight);
     
    151151
    152152static double
    153 FetchDocStartLev2 (text_data * td, u_long DN,
    154            u_long * seek_pos, u_long * len)
     153FetchDocStartLev2 (text_data * td, mg_u_long DN,
     154           mg_u_long * seek_pos, mg_u_long * len)
    155155{
    156156  double Weight;
    157   unsigned long s1, s2;
     157  mg_u_long s1, s2;
    158158  Weight = FDSL2 (td, DN, &s1);
    159159  do
     
    172172
    173173double
    174 FetchDocStart (query_data * qd, u_long DN, u_long * seek_pos, u_long * len)
     174FetchDocStart (query_data * qd, mg_u_long DN, mg_u_long * seek_pos, mg_u_long * len)
    175175{
    176176  qd->text_idx_lookups++;
     
    181181}
    182182
    183 unsigned long
    184 FetchInitialParagraph (text_data * td, unsigned long ParaNum)
     183mg_u_long
     184FetchInitialParagraph (text_data * td, mg_u_long ParaNum)
    185185{
    186186  if (td->TextIdxWgtFile)
    187187    {
    188       unsigned long pos;
    189       unsigned long start;
     188      mg_u_long pos;
     189      mg_u_long start;
    190190      int PN = ParaNum - 1;
    191191      pos = LoadIdx (td, ParaNum);
     
    583583    {
    584584      huff_data *hd;
    585       u_long **vals;
     585      mg_u_long **vals;
    586586      if (cd->cdh.num_words[which])
    587587        {
     
    625625    {
    626626      huff_data *hd;
    627       u_long **vals;
     627      mg_u_long **vals;
    628628      if (cd->cdh.num_words[which])
    629629        {
     
    716716{
    717717  compression_dict *cd;
    718   u_long *p, *end;
     718  uintptr_t *p, *end;
    719719  u_char *fixup;
    720   u_long mem;
    721   u_long fixup_mem;
     720  mg_u_long mem;
     721  mg_u_long fixup_mem;
    722722  int i;  /* [RPAP - Jan 97: Endian Ordering] */
    723723
     
    732732    }
    733733
    734   end = (u_long *) (((u_char *) cd) + mem);
     734  end = (uintptr_t *) (((u_char *) cd) + mem);
    735735  Fread (cd, sizeof (u_char), mem, text_fast_comp_dict);
    736736
     
    743743  Fread (fixup, fixup_mem, sizeof (u_char), text_fast_comp_dict);
    744744
    745   for (p = (u_long *) cd; (u_long) p < (u_long) end; p++)
     745  for (p = (uintptr_t *) cd; (uintptr_t) p < (uintptr_t) end; p++)
    746746    if (IS_FIXUP (p))
    747747      {
    748748    NTOHUL(*p);  /* [RPAP - Jan 97: Endian Ordering] */
    749     *p = *p + (u_long) cd;
     749    *p = *p + (uintptr_t) cd;
    750750      }
    751751
     
    863863#define MY_HUFF_DECODE(len, code, mcodes)               \
    864864  do {                                  \
    865     register unsigned long *__min_code = (mcodes);          \
    866     register unsigned long *__mclen = __min_code;           \
    867     register unsigned long __code = 0;                  \
     865    register mg_u_long *__min_code = (mcodes);          \
     866    register mg_u_long *__mclen = __min_code;           \
     867    register mg_u_long __code = 0;                  \
    868868    do                                  \
    869869      {                                 \
     
    886886  auxiliary_dict *ad = cd->ad;
    887887  int which;
    888   u_long num_bits, bits;
     888  mg_u_long num_bits, bits;
    889889  u_char *ptr = s_out;
    890890  static int num = 0;
    891   u_long binary_start[2];
     891  mg_u_long binary_start[2];
    892892  int novels_used[2];
    893893  int swaps[2][MAX_SWAPS];
  • main/trunk/greenstone2/common-src/indexers/mg/src/text/text_get.h

    r16583 r25147  
    3232 * It returns the true weight of the document.
    3333 */
    34 double FetchDocStart (query_data * qd, u_long DN, u_long * seek_pos, u_long * len);
     34double FetchDocStart (query_data * qd, mg_u_long DN, mg_u_long * seek_pos, mg_u_long * len);
    3535
    36 unsigned long FetchInitialParagraph (text_data * td, unsigned long ParaNum);
     36mg_u_long FetchInitialParagraph (text_data * td, mg_u_long ParaNum);
    3737
    3838
  • main/trunk/greenstone2/common-src/indexers/mg/src/text/weights.c

    r16583 r25147  
    3939#include "mg_errors.h"
    4040
    41 #define MAXBITS (sizeof(unsigned long) * 8)
     41#define MAXBITS (sizeof(mg_u_long) * 8)
    4242
    4343/*
     
    6363approx_weights_data *
    6464LoadDocWeights (File * weight_file,
    65         unsigned long num_of_docs)
     65        mg_u_long num_of_docs)
    6666{
    6767  approx_weights_data *awd;
     
    7474    }
    7575
    76   Fseek (weight_file, sizeof (long), 0);
     76  Fseek (weight_file, sizeof (mg_s_long), 0);
    7777  Fread (&awd->bits, sizeof (awd->bits), 1, weight_file);
    7878  Fread (&awd->L, sizeof (awd->L), 1, weight_file);
     
    8484
    8585  num = (num_of_docs * awd->bits + 31) / 32;
    86   if (!(awd->DocWeights = Xmalloc (sizeof (unsigned long) * num)))
     86  if (!(awd->DocWeights = Xmalloc (sizeof (mg_u_long) * num)))
    8787    {
    8888      Xfree (awd);
     
    9191    }
    9292
    93   Fread (awd->DocWeights, sizeof (unsigned long), num, weight_file);
     93  Fread (awd->DocWeights, sizeof (mg_u_long), num, weight_file);
    9494  {
    9595    /* [RPAP - Jan 97: Endian Ordering] */
    96     unsigned long i;
     96    mg_u_long i;
    9797    for (i = 0; i < num; i++)
    9898      NTOHUL(awd->DocWeights[i]);
    9999  }
    100100
    101   awd->MemForWeights = num * sizeof (unsigned long);
     101  awd->MemForWeights = num * sizeof (mg_u_long);
    102102  awd->num_of_docs = num_of_docs;
    103103
     
    129129GetLowerApproxDocWeight (approx_weights_data * awd, register int DocNum)
    130130{
    131   register unsigned long c, Pos;
    132   register unsigned long *dw;
     131  register mg_u_long c, Pos;
     132  register mg_u_long *dw;
    133133  if (awd == NULL)
    134134    return 1.0;
  • main/trunk/greenstone2/common-src/indexers/mg/src/text/weights.h

    r16583 r25147  
    2626
    2727approx_weights_data *LoadDocWeights (File * weight_file,
    28                      unsigned long num_of_docs);
     28                     mg_u_long num_of_docs);
    2929
    3030float GetLowerApproxDocWeight (approx_weights_data * awd, register int DocNum);
  • main/trunk/greenstone2/common-src/indexers/mg/sysfuncs.h

    r16583 r25147  
    351351#endif
    352352
    353 /* [RPAP - Feb 97: WIN32 Port] */
    354 #ifndef u_long
    355 # define u_long unsigned long
    356 #endif
     353#include "mglong.h"
     354
    357355#ifndef u_char
    358356# define u_char unsigned char
    359357#endif
    360358
    361 
    362359#endif /* SYSFUNCS_H */
Note: See TracChangeset for help on using the changeset viewer.