which command can be used instead of enum for long integers?

This is a discussion on which command can be used instead of enum for long integers? within the C Programming forums, part of the General Programming Boards category; i have following as a part of one of the header files in a C program. Code: typedef enum { ...

  1. #1
    Registered User
    Join Date
    Feb 2009
    Posts
    3

    which command can be used instead of enum for long integers?

    i have following as a part of one of the header files in a C program.
    Code:
    typedef enum {
        icSigAToB0Tag                       = 0x41324230L,  /* 'A2B0' */ 
        icSigAToB1Tag                       = 0x41324231L,  /* 'A2B1' */
        icSigAToB2Tag                       = 0x41324232L,  /* 'A2B2' */ 
        icSigBlueColorantTag                = 0x6258595AL,  /* 'bXYZ' */
        icSigBlueTRCTag                     = 0x62545243L,  /* 'bTRC' */
        icSigBToA0Tag                       = 0x42324130L,  /* 'B2A0' */
        icSigBToA1Tag                       = 0x42324131L,  /* 'B2A1' */
        icSigBToA2Tag                       = 0x42324132L,  /* 'B2A2' */
        icSigCalibrationDateTimeTag         = 0x63616C74L,  /* 'calt' */
        icSigCharTargetTag                  = 0x74617267L,  /* 'targ' */ 
        icSigCopyrightTag                   = 0x63707274L,  /* 'cprt' */
        icSigCrdInfoTag                     = 0x63726469L,  /* 'crdi' */
        icSigDeviceMfgDescTag               = 0x646D6E64L,  /* 'dmnd' */
        icSigDeviceModelDescTag             = 0x646D6464L,  /* 'dmdd' */
        icSigGamutTag                       = 0x67616D74L,  /* 'gamt ' */
        icSigGrayTRCTag                     = 0x6b545243L,  /* 'kTRC' */
        icSigGreenColorantTag               = 0x6758595AL,  /* 'gXYZ' */
        icSigGreenTRCTag                    = 0x67545243L,  /* 'gTRC' */
        icSigLuminanceTag                   = 0x6C756d69L,  /* 'lumi' */
        icSigMeasurementTag                 = 0x6D656173L,  /* 'meas' */
        icSigMediaBlackPointTag             = 0x626B7074L,  /* 'bkpt' */
        icSigMediaWhitePointTag             = 0x77747074L,  /* 'wtpt' */
        icSigNamedColorTag                  = 0x6E636f6CL,  /* 'ncol' 
                                                             * OBSOLETE, use ncl2 */
        icSigNamedColor2Tag                 = 0x6E636C32L,  /* 'ncl2' */
        icSigPreview0Tag                    = 0x70726530L,  /* 'pre0' */
        icSigPreview1Tag                    = 0x70726531L,  /* 'pre1' */
        icSigPreview2Tag                    = 0x70726532L,  /* 'pre2' */
        icSigProfileDescriptionTag          = 0x64657363L,  /* 'desc' */
        icSigProfileSequenceDescTag         = 0x70736571L,  /* 'pseq' */
        icSigPs2CRD0Tag                     = 0x70736430L,  /* 'psd0' */
        icSigPs2CRD1Tag                     = 0x70736431L,  /* 'psd1' */
        icSigPs2CRD2Tag                     = 0x70736432L,  /* 'psd2' */
        icSigPs2CRD3Tag                     = 0x70736433L,  /* 'psd3' */
        icSigPs2CSATag                      = 0x70733273L,  /* 'ps2s' */
        icSigPs2RenderingIntentTag          = 0x70733269L,  /* 'ps2i' */
        icSigRedColorantTag                 = 0x7258595AL,  /* 'rXYZ' */
        icSigRedTRCTag                      = 0x72545243L,  /* 'rTRC' */
        icSigScreeningDescTag               = 0x73637264L,  /* 'scrd' */
        icSigScreeningTag                   = 0x7363726EL,  /* 'scrn' */
        icSigTechnologyTag                  = 0x74656368L,  /* 'tech' */
        icSigUcrBgTag                       = 0x62666420L,  /* 'bfd ' */
        icSigViewingCondDescTag             = 0x76756564L,  /* 'vued' */
        icSigViewingConditionsTag           = 0x76696577L,  /* 'view' */
        icMaxEnumTag                        = 0xFFFFFFFFL 
    } icTagSignature;
    it shows error.the error states that the value of variables used here is beyond the range of integer.so plz can any1 suggest me some other command than enum, which can be used for a range that is larger than integer range?

  2. #2
    Captain Crash brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,270
    Let me guess... You're using Turbo C++?
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

  3. #3
    CSharpener vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,484
    #define
    The first 90% of a project takes 90% of the time,
    the last 10% takes the other 90% of the time.

  4. #4
    Technical Lead QuantumPete's Avatar
    Join Date
    Aug 2007
    Location
    London, UK
    Posts
    894
    Quote Originally Posted by vart View Post
    #define
    const long
    You should only use #define if you're using C89 (or want backwards capability) and need to size an array according to a constant. Otherwise global const long variables are much neater.

    QuantumPete
    "No-one else has reported this problem, you're either crazy or a liar" - Dogbert Technical Support
    "Have you tried turning it off and on again?" - The IT Crowd

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Link List math
    By t014y in forum C Programming
    Replies: 17
    Last Post: 02-20-2009, 06:55 PM
  2. Assignment HELP!!
    By cprogrammer22 in forum C Programming
    Replies: 35
    Last Post: 01-24-2009, 02:24 PM
  3. enum [tag] [: type] Is this non-standard?
    By HyperShadow in forum C++ Programming
    Replies: 2
    Last Post: 12-09-2007, 10:29 PM
  4. Switch case and enum help
    By SomeCrazyGuy in forum C++ Programming
    Replies: 9
    Last Post: 04-21-2005, 09:53 PM
  5. Replies: 6
    Last Post: 08-04-2003, 11:57 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21