Changeset 12490 for trunk/FACT++


Ignore:
Timestamp:
11/11/11 01:51:35 (13 years ago)
Author:
tbretz
Message:
Set C to STDC
Location:
trunk/FACT++
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/Makefile.in

    r12354 r12490  
    351351        gui/RawEventsViewer/RawEventsViewer.cc gui/BasicGlCamera.cc \
    352352        gui/QCameraWidget.cc src/DataProcessorImp.cc \
    353         src/DataProcessorImp.h src/FitsFile.cc src/FitsFile.h
     353        src/DataProcessorImp.h src/FitsFile.cc src/FitsFile.h \
     354        src/Fits.cc src/Fits.h src/PixelMap.cc
    354355@HAS_VIEWER_TRUE@am__objects_8 = gui/RawEventsViewer/RawEventsViewer.moc.$(OBJEXT) \
    355356@HAS_VIEWER_TRUE@       gui/BasicGlCamera.moc.$(OBJEXT) \
     
    360361@HAS_VIEWER_TRUE@       gui/QCameraWidget.$(OBJEXT)
    361362am_viewer_OBJECTS = $(am__objects_9) $(am__objects_10) \
    362         src/DataProcessorImp.$(OBJEXT) src/FitsFile.$(OBJEXT)
     363        src/DataProcessorImp.$(OBJEXT) src/FitsFile.$(OBJEXT) \
     364        src/Fits.$(OBJEXT) src/PixelMap.$(OBJEXT)
    363365viewer_OBJECTS = $(am_viewer_OBJECTS)
    364366viewer_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
     
    958960viewer_SOURCES = $(viewer_SRCADD) $(viewer_QT_SOURCES) \
    959961        src/DataProcessorImp.cc src/DataProcessorImp.h \
    960         src/FitsFile.cc  src/FitsFile.h
     962        src/FitsFile.cc  src/FitsFile.h \
     963        src/Fits.cc      src/Fits.h \
     964        src/PixelMap.cc
    961965
    962966
     
    22562260        uninstall-libLTLIBRARIES uninstall-man uninstall-man1
    22572261
    2258         src/Fits.cc      src/Fits.h
    22592262
    22602263.ui.h: $<
  • trunk/FACT++/configure

    r11822 r12490  
    38233823ac_compiler_gnu=$ac_cv_c_compiler_gnu
    38243824
     3825   case $ac_cv_prog_cc_stdc in #(
     3826  no) :
     3827    ac_cv_prog_cc_c99=no; ac_cv_prog_cc_c89=no ;; #(
     3828  *) :
     3829    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5
     3830$as_echo_n "checking for $CC option to accept ISO C99... " >&6; }
     3831if test "${ac_cv_prog_cc_c99+set}" = set; then :
     3832  $as_echo_n "(cached) " >&6
     3833else
     3834  ac_cv_prog_cc_c99=no
     3835ac_save_CC=$CC
     3836cat confdefs.h - <<_ACEOF >conftest.$ac_ext
     3837/* end confdefs.h.  */
     3838#include <stdarg.h>
     3839#include <stdbool.h>
     3840#include <stdlib.h>
     3841#include <wchar.h>
     3842#include <stdio.h>
     3843
     3844// Check varargs macros.  These examples are taken from C99 6.10.3.5.
     3845#define debug(...) fprintf (stderr, __VA_ARGS__)
     3846#define showlist(...) puts (#__VA_ARGS__)
     3847#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
     3848static void
     3849test_varargs_macros (void)
     3850{
     3851  int x = 1234;
     3852  int y = 5678;
     3853  debug ("Flag");
     3854  debug ("X = %d\n", x);
     3855  showlist (The first, second, and third items.);
     3856  report (x>y, "x is %d but y is %d", x, y);
     3857}
     3858
     3859// Check long long types.
     3860#define BIG64 18446744073709551615ull
     3861#define BIG32 4294967295ul
     3862#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
     3863#if !BIG_OK
     3864  your preprocessor is broken;
     3865#endif
     3866#if BIG_OK
     3867#else
     3868  your preprocessor is broken;
     3869#endif
     3870static long long int bignum = -9223372036854775807LL;
     3871static unsigned long long int ubignum = BIG64;
     3872
     3873struct incomplete_array
     3874{
     3875  int datasize;
     3876  double data[];
     3877};
     3878
     3879struct named_init {
     3880  int number;
     3881  const wchar_t *name;
     3882  double average;
     3883};
     3884
     3885typedef const char *ccp;
     3886
     3887static inline int
     3888test_restrict (ccp restrict text)
     3889{
     3890  // See if C++-style comments work.
     3891  // Iterate through items via the restricted pointer.
     3892  // Also check for declarations in for loops.
     3893  for (unsigned int i = 0; *(text+i) != '\0'; ++i)
     3894    continue;
     3895  return 0;
     3896}
     3897
     3898// Check varargs and va_copy.
     3899static void
     3900test_varargs (const char *format, ...)
     3901{
     3902  va_list args;
     3903  va_start (args, format);
     3904  va_list args_copy;
     3905  va_copy (args_copy, args);
     3906
     3907  const char *str;
     3908  int number;
     3909  float fnumber;
     3910
     3911  while (*format)
     3912    {
     3913      switch (*format++)
     3914        {
     3915        case 's': // string
     3916          str = va_arg (args_copy, const char *);
     3917          break;
     3918        case 'd': // int
     3919          number = va_arg (args_copy, int);
     3920          break;
     3921        case 'f': // float
     3922          fnumber = va_arg (args_copy, double);
     3923          break;
     3924        default:
     3925          break;
     3926        }
     3927    }
     3928  va_end (args_copy);
     3929  va_end (args);
     3930}
     3931
     3932int
     3933main ()
     3934{
     3935
     3936  // Check bool.
     3937  _Bool success = false;
     3938
     3939  // Check restrict.
     3940  if (test_restrict ("String literal") == 0)
     3941    success = true;
     3942  char *restrict newvar = "Another string";
     3943
     3944  // Check varargs.
     3945  test_varargs ("s, d' f .", "string", 65, 34.234);
     3946  test_varargs_macros ();
     3947
     3948  // Check flexible array members.
     3949  struct incomplete_array *ia =
     3950    malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
     3951  ia->datasize = 10;
     3952  for (int i = 0; i < ia->datasize; ++i)
     3953    ia->data[i] = i * 1.234;
     3954
     3955  // Check named initializers.
     3956  struct named_init ni = {
     3957    .number = 34,
     3958    .name = L"Test wide string",
     3959    .average = 543.34343,
     3960  };
     3961
     3962  ni.number = 58;
     3963
     3964  int dynamic_array[ni.number];
     3965  dynamic_array[ni.number - 1] = 543;
     3966
     3967  // work around unused variable warnings
     3968  return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x'
     3969          || dynamic_array[ni.number - 1] != 543);
     3970
     3971  ;
     3972  return 0;
     3973}
     3974_ACEOF
     3975for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -xc99=all -qlanglvl=extc99
     3976do
     3977  CC="$ac_save_CC $ac_arg"
     3978  if ac_fn_c_try_compile "$LINENO"; then :
     3979  ac_cv_prog_cc_c99=$ac_arg
     3980fi
     3981rm -f core conftest.err conftest.$ac_objext
     3982  test "x$ac_cv_prog_cc_c99" != "xno" && break
     3983done
     3984rm -f conftest.$ac_ext
     3985CC=$ac_save_CC
     3986
     3987fi
     3988# AC_CACHE_VAL
     3989case "x$ac_cv_prog_cc_c99" in
     3990  x)
     3991    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
     3992$as_echo "none needed" >&6; } ;;
     3993  xno)
     3994    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
     3995$as_echo "unsupported" >&6; } ;;
     3996  *)
     3997    CC="$CC $ac_cv_prog_cc_c99"
     3998    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5
     3999$as_echo "$ac_cv_prog_cc_c99" >&6; } ;;
     4000esac
     4001if test "x$ac_cv_prog_cc_c99" != xno; then :
     4002  ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99
     4003else
     4004  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
     4005$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
     4006if test "${ac_cv_prog_cc_c89+set}" = set; then :
     4007  $as_echo_n "(cached) " >&6
     4008else
     4009  ac_cv_prog_cc_c89=no
     4010ac_save_CC=$CC
     4011cat confdefs.h - <<_ACEOF >conftest.$ac_ext
     4012/* end confdefs.h.  */
     4013#include <stdarg.h>
     4014#include <stdio.h>
     4015#include <sys/types.h>
     4016#include <sys/stat.h>
     4017/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
     4018struct buf { int x; };
     4019FILE * (*rcsopen) (struct buf *, struct stat *, int);
     4020static char *e (p, i)
     4021     char **p;
     4022     int i;
     4023{
     4024  return p[i];
     4025}
     4026static char *f (char * (*g) (char **, int), char **p, ...)
     4027{
     4028  char *s;
     4029  va_list v;
     4030  va_start (v,p);
     4031  s = g (p, va_arg (v,int));
     4032  va_end (v);
     4033  return s;
     4034}
     4035
     4036/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
     4037   function prototypes and stuff, but not '\xHH' hex character constants.
     4038   These don't provoke an error unfortunately, instead are silently treated
     4039   as 'x'.  The following induces an error, until -std is added to get
     4040   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
     4041   array size at least.  It's necessary to write '\x00'==0 to get something
     4042   that's true only with -std.  */
     4043int osf4_cc_array ['\x00' == 0 ? 1 : -1];
     4044
     4045/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
     4046   inside strings and character constants.  */
     4047#define FOO(x) 'x'
     4048int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
     4049
     4050int test (int i, double x);
     4051struct s1 {int (*f) (int a);};
     4052struct s2 {int (*f) (double a);};
     4053int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
     4054int argc;
     4055char **argv;
     4056int
     4057main ()
     4058{
     4059return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
     4060  ;
     4061  return 0;
     4062}
     4063_ACEOF
     4064for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
     4065        -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
     4066do
     4067  CC="$ac_save_CC $ac_arg"
     4068  if ac_fn_c_try_compile "$LINENO"; then :
     4069  ac_cv_prog_cc_c89=$ac_arg
     4070fi
     4071rm -f core conftest.err conftest.$ac_objext
     4072  test "x$ac_cv_prog_cc_c89" != "xno" && break
     4073done
     4074rm -f conftest.$ac_ext
     4075CC=$ac_save_CC
     4076
     4077fi
     4078# AC_CACHE_VAL
     4079case "x$ac_cv_prog_cc_c89" in
     4080  x)
     4081    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
     4082$as_echo "none needed" >&6; } ;;
     4083  xno)
     4084    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
     4085$as_echo "unsupported" >&6; } ;;
     4086  *)
     4087    CC="$CC $ac_cv_prog_cc_c89"
     4088    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
     4089$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
     4090esac
     4091if test "x$ac_cv_prog_cc_c89" != xno; then :
     4092  ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89
     4093else
     4094  ac_cv_prog_cc_stdc=no
     4095fi
     4096
     4097fi
     4098 ;;
     4099esac
     4100  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO Standard C" >&5
     4101$as_echo_n "checking for $CC option to accept ISO Standard C... " >&6; }
     4102  if test "${ac_cv_prog_cc_stdc+set}" = set; then :
     4103  $as_echo_n "(cached) " >&6
     4104fi
     4105
     4106  case $ac_cv_prog_cc_stdc in #(
     4107  no) :
     4108    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
     4109$as_echo "unsupported" >&6; } ;; #(
     4110  '') :
     4111    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
     4112$as_echo "none needed" >&6; } ;; #(
     4113  *) :
     4114    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_stdc" >&5
     4115$as_echo "$ac_cv_prog_cc_stdc" >&6; } ;;
     4116esac
     4117
     4118#AC_PROG_CC_C99
    38254119
    38264120######################################################################
     
    48425136  lt_cv_nm_interface="BSD nm"
    48435137  echo "int some_variable = 0;" > conftest.$ac_ext
    4844   (eval echo "\"\$as_me:4844: $ac_compile\"" >&5)
     5138  (eval echo "\"\$as_me:5138: $ac_compile\"" >&5)
    48455139  (eval "$ac_compile" 2>conftest.err)
    48465140  cat conftest.err >&5
    4847   (eval echo "\"\$as_me:4847: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
     5141  (eval echo "\"\$as_me:5141: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
    48485142  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
    48495143  cat conftest.err >&5
    4850   (eval echo "\"\$as_me:4850: output\"" >&5)
     5144  (eval echo "\"\$as_me:5144: output\"" >&5)
    48515145  cat conftest.out >&5
    48525146  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
     
    60536347*-*-irix6*)
    60546348  # Find out which ABI we are using.
    6055   echo '#line 6055 "configure"' > conftest.$ac_ext
     6349  echo '#line 6349 "configure"' > conftest.$ac_ext
    60566350  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
    60576351  (eval $ac_compile) 2>&5
     
    77148008   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    77158009   -e 's:$: $lt_compiler_flag:'`
    7716    (eval echo "\"\$as_me:7716: $lt_compile\"" >&5)
     8010   (eval echo "\"\$as_me:8010: $lt_compile\"" >&5)
    77178011   (eval "$lt_compile" 2>conftest.err)
    77188012   ac_status=$?
    77198013   cat conftest.err >&5
    7720    echo "$as_me:7720: \$? = $ac_status" >&5
     8014   echo "$as_me:8014: \$? = $ac_status" >&5
    77218015   if (exit $ac_status) && test -s "$ac_outfile"; then
    77228016     # The compiler can only warn and ignore the option if not recognized
     
    80538347   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    80548348   -e 's:$: $lt_compiler_flag:'`
    8055    (eval echo "\"\$as_me:8055: $lt_compile\"" >&5)
     8349   (eval echo "\"\$as_me:8349: $lt_compile\"" >&5)
    80568350   (eval "$lt_compile" 2>conftest.err)
    80578351   ac_status=$?
    80588352   cat conftest.err >&5
    8059    echo "$as_me:8059: \$? = $ac_status" >&5
     8353   echo "$as_me:8353: \$? = $ac_status" >&5
    80608354   if (exit $ac_status) && test -s "$ac_outfile"; then
    80618355     # The compiler can only warn and ignore the option if not recognized
     
    81588452   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    81598453   -e 's:$: $lt_compiler_flag:'`
    8160    (eval echo "\"\$as_me:8160: $lt_compile\"" >&5)
     8454   (eval echo "\"\$as_me:8454: $lt_compile\"" >&5)
    81618455   (eval "$lt_compile" 2>out/conftest.err)
    81628456   ac_status=$?
    81638457   cat out/conftest.err >&5
    8164    echo "$as_me:8164: \$? = $ac_status" >&5
     8458   echo "$as_me:8458: \$? = $ac_status" >&5
    81658459   if (exit $ac_status) && test -s out/conftest2.$ac_objext
    81668460   then
     
    82138507   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    82148508   -e 's:$: $lt_compiler_flag:'`
    8215    (eval echo "\"\$as_me:8215: $lt_compile\"" >&5)
     8509   (eval echo "\"\$as_me:8509: $lt_compile\"" >&5)
    82168510   (eval "$lt_compile" 2>out/conftest.err)
    82178511   ac_status=$?
    82188512   cat out/conftest.err >&5
    8219    echo "$as_me:8219: \$? = $ac_status" >&5
     8513   echo "$as_me:8513: \$? = $ac_status" >&5
    82208514   if (exit $ac_status) && test -s out/conftest2.$ac_objext
    82218515   then
     
    1059710891  lt_status=$lt_dlunknown
    1059810892  cat > conftest.$ac_ext <<_LT_EOF
    10599 #line 10599 "configure"
     10893#line 10893 "configure"
    1060010894#include "confdefs.h"
    1060110895
     
    1069310987  lt_status=$lt_dlunknown
    1069410988  cat > conftest.$ac_ext <<_LT_EOF
    10695 #line 10695 "configure"
     10989#line 10989 "configure"
    1069610990#include "confdefs.h"
    1069710991
     
    1264912943   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    1265012944   -e 's:$: $lt_compiler_flag:'`
    12651    (eval echo "\"\$as_me:12651: $lt_compile\"" >&5)
     12945   (eval echo "\"\$as_me:12945: $lt_compile\"" >&5)
    1265212946   (eval "$lt_compile" 2>conftest.err)
    1265312947   ac_status=$?
    1265412948   cat conftest.err >&5
    12655    echo "$as_me:12655: \$? = $ac_status" >&5
     12949   echo "$as_me:12949: \$? = $ac_status" >&5
    1265612950   if (exit $ac_status) && test -s "$ac_outfile"; then
    1265712951     # The compiler can only warn and ignore the option if not recognized
     
    1274813042   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    1274913043   -e 's:$: $lt_compiler_flag:'`
    12750    (eval echo "\"\$as_me:12750: $lt_compile\"" >&5)
     13044   (eval echo "\"\$as_me:13044: $lt_compile\"" >&5)
    1275113045   (eval "$lt_compile" 2>out/conftest.err)
    1275213046   ac_status=$?
    1275313047   cat out/conftest.err >&5
    12754    echo "$as_me:12754: \$? = $ac_status" >&5
     13048   echo "$as_me:13048: \$? = $ac_status" >&5
    1275513049   if (exit $ac_status) && test -s out/conftest2.$ac_objext
    1275613050   then
     
    1280013094   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    1280113095   -e 's:$: $lt_compiler_flag:'`
    12802    (eval echo "\"\$as_me:12802: $lt_compile\"" >&5)
     13096   (eval echo "\"\$as_me:13096: $lt_compile\"" >&5)
    1280313097   (eval "$lt_compile" 2>out/conftest.err)
    1280413098   ac_status=$?
    1280513099   cat out/conftest.err >&5
    12806    echo "$as_me:12806: \$? = $ac_status" >&5
     13100   echo "$as_me:13100: \$? = $ac_status" >&5
    1280713101   if (exit $ac_status) && test -s out/conftest2.$ac_objext
    1280813102   then
     
    2209022384
    2209122385                cat > conftest.$ac_ext <<EOF
    22092 #line 22092 "configure"
     22386#line 22386 "configure"
    2209322387#include "confdefs.h"
    2209422388#include <qglobal.h>
  • trunk/FACT++/configure.ac

    r12058 r12490  
    1717AC_PROG_CC([colorgcc gcc])
    1818AC_PROG_CXX([colorgcc g++])
     19AC_PROG_CC_STDC
     20#AC_PROG_CC_C99
    1921
    2022######################################################################
Note: See TracChangeset for help on using the changeset viewer.