Search Results

Search found 6079 results on 244 pages for 'define'.

Page 1/244 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Xcode newb -- #include can't find my file

    - by morgancodes
    I'm trying to get a third party audio library (STK) working inside Xcode. Along with the standard .h files, many of the implementation files include a file called SKINI.msg. SKINI.msg is in the same directory as all of the header files. The header files are getting included fine, but the compiler complains that it can't find SKINI.msg. What do I need to do to get Xcode to happily include SKINI.msg? Edit: Here's the contents of SKINI.msg: /*********************************************************/ /* Definition of SKINI Message Types and Special Symbols Synthesis toolKit Instrument Network Interface These symbols should have the form: \c __SK_<name>_ where <name> is the string used in the SKINI stream. by Perry R. Cook, 1995 - 2010. */ /*********************************************************/ namespace stk { #define NOPE -32767 #define YEP 1 #define SK_DBL -32766 #define SK_INT -32765 #define SK_STR -32764 #define __SK_Exit_ 999 /***** MIDI COMPATIBLE MESSAGES *****/ /*** (Status bytes for channel=0) ***/ #define __SK_NoteOff_ 128 #define __SK_NoteOn_ 144 #define __SK_PolyPressure_ 160 #define __SK_ControlChange_ 176 #define __SK_ProgramChange_ 192 #define __SK_AfterTouch_ 208 #define __SK_ChannelPressure_ __SK_AfterTouch_ #define __SK_PitchWheel_ 224 #define __SK_PitchBend_ __SK_PitchWheel_ #define __SK_PitchChange_ 49 #define __SK_Clock_ 248 #define __SK_SongStart_ 250 #define __SK_Continue_ 251 #define __SK_SongStop_ 252 #define __SK_ActiveSensing_ 254 #define __SK_SystemReset_ 255 #define __SK_Volume_ 7 #define __SK_ModWheel_ 1 #define __SK_Modulation_ __SK_ModWheel_ #define __SK_Breath_ 2 #define __SK_FootControl_ 4 #define __SK_Portamento_ 65 #define __SK_Balance_ 8 #define __SK_Pan_ 10 #define __SK_Sustain_ 64 #define __SK_Damper_ __SK_Sustain_ #define __SK_Expression_ 11 #define __SK_AfterTouch_Cont_ 128 #define __SK_ModFrequency_ __SK_Expression_ #define __SK_ProphesyRibbon_ 16 #define __SK_ProphesyWheelUp_ 2 #define __SK_ProphesyWheelDown_ 3 #define __SK_ProphesyPedal_ 18 #define __SK_ProphesyKnob1_ 21 #define __SK_ProphesyKnob2_ 22 /*** Instrument Family Specific ***/ #define __SK_NoiseLevel_ __SK_FootControl_ #define __SK_PickPosition_ __SK_FootControl_ #define __SK_StringDamping_ __SK_Expression_ #define __SK_StringDetune_ __SK_ModWheel_ #define __SK_BodySize_ __SK_Breath_ #define __SK_BowPressure_ __SK_Breath_ #define __SK_BowPosition_ __SK_PickPosition_ #define __SK_BowBeta_ __SK_BowPosition_ #define __SK_ReedStiffness_ __SK_Breath_ #define __SK_ReedRestPos_ __SK_FootControl_ #define __SK_FluteEmbouchure_ __SK_Breath_ #define __SK_JetDelay_ __SK_FluteEmbouchure_ #define __SK_LipTension_ __SK_Breath_ #define __SK_SlideLength_ __SK_FootControl_ #define __SK_StrikePosition_ __SK_PickPosition_ #define __SK_StickHardness_ __SK_Breath_ #define __SK_TrillDepth_ 1051 #define __SK_TrillSpeed_ 1052 #define __SK_StrumSpeed_ __SK_TrillSpeed_ #define __SK_RollSpeed_ __SK_TrillSpeed_ #define __SK_FilterQ_ __SK_Breath_ #define __SK_FilterFreq_ 1062 #define __SK_FilterSweepRate_ __SK_FootControl_ #define __SK_ShakerInst_ 1071 #define __SK_ShakerEnergy_ __SK_Breath_ #define __SK_ShakerDamping_ __SK_ModFrequency_ #define __SK_ShakerNumObjects_ __SK_FootControl_ #define __SK_Strumming_ 1090 #define __SK_NotStrumming_ 1091 #define __SK_Trilling_ 1092 #define __SK_NotTrilling_ 1093 #define __SK_Rolling_ __SK_Strumming_ #define __SK_NotRolling_ __SK_NotStrumming_ #define __SK_PlayerSkill_ 2001 #define __SK_Chord_ 2002 #define __SK_ChordOff_ 2003 #define __SK_SINGER_FilePath_ 3000 #define __SK_SINGER_Frequency_ 3001 #define __SK_SINGER_NoteName_ 3002 #define __SK_SINGER_Shape_ 3003 #define __SK_SINGER_Glot_ 3004 #define __SK_SINGER_VoicedUnVoiced_ 3005 #define __SK_SINGER_Synthesize_ 3006 #define __SK_SINGER_Silence_ 3007 #define __SK_SINGER_VibratoAmt_ __SK_ModWheel_ #define __SK_SINGER_RndVibAmt_ 3008 #define __SK_SINGER_VibFreq_ __SK_Expression_ } // stk namespace And here's what the compiler said: CompileC build/StkCompile.build/Debug-iphonesimulator/StkCompile.build/Objects-normal/i386/BandedWG.o "../../../Data/study/iPhone class/stk-4.4.2/src/BandedWG.cpp" normal i386 c++ com.apple.compilers.gcc.4_2 cd /Users/morganpackard/Desktop/trashme/StkCompile setenv LANG en_US.US-ASCII setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 -x c++ -arch i386 -fmessage-length=0 -pipe -Wno-trigraphs -fpascal-strings -fasm-blocks -O0 -Wreturn-type -Wunused-variable -D__IPHONE_OS_VERSION_MIN_REQUIRED=30000 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.1.2.sdk -fvisibility=hidden -fvisibility-inlines-hidden -mmacosx-version-min=10.5 -gdwarf-2 -iquote /Users/morganpackard/Desktop/trashme/StkCompile/build/StkCompile.build/Debug-iphonesimulator/StkCompile.build/StkCompile-generated-files.hmap -I/Users/morganpackard/Desktop/trashme/StkCompile/build/StkCompile.build/Debug-iphonesimulator/StkCompile.build/StkCompile-own-target-headers.hmap -I/Users/morganpackard/Desktop/trashme/StkCompile/build/StkCompile.build/Debug-iphonesimulator/StkCompile.build/StkCompile-all-target-headers.hmap -iquote /Users/morganpackard/Desktop/trashme/StkCompile/build/StkCompile.build/Debug-iphonesimulator/StkCompile.build/StkCompile-project-headers.hmap -F/Users/morganpackard/Desktop/trashme/StkCompile/build/Debug-iphonesimulator -I/Users/morganpackard/Desktop/trashme/StkCompile/build/Debug-iphonesimulator/include -I/Users/morganpackard/Desktop/trashme/StkCompile/build/StkCompile.build/Debug-iphonesimulator/StkCompile.build/DerivedSources/i386 -I/Users/morganpackard/Desktop/trashme/StkCompile/build/StkCompile.build/Debug-iphonesimulator/StkCompile.build/DerivedSources -include /var/folders/dx/dxSUSyOJFv0MBEh9qC1oJ++++TI/-Caches-/com.apple.Xcode.501/SharedPrecompiledHeaders/StkCompile_Prefix-bopqzvwpuyqltrdumgtjtfrjvtzb/StkCompile_Prefix.pch -c "/Users/morganpackard/Desktop/trashme/StkCompile/../../../Data/study/iPhone class/stk-4.4.2/src/BandedWG.cpp" -o /Users/morganpackard/Desktop/trashme/StkCompile/build/StkCompile.build/Debug-iphonesimulator/StkCompile.build/Objects-normal/i386/BandedWG.o /Users/morganpackard/Desktop/trashme/StkCompile/../../../Data/study/iPhone class/stk-4.4.2/src/BandedWG.cpp:33:21: error: SKINI.msg: No such file or directory /Users/morganpackard/Desktop/trashme/StkCompile/../../../Data/study/iPhone class/stk-4.4.2/src/BandedWG.cpp: In member function 'virtual void stk::BandedWG::controlChange(int, stk::StkFloat)': /Users/morganpackard/Desktop/trashme/StkCompile/../../../Data/study/iPhone class/stk-4.4.2/src/BandedWG.cpp:326: error: '__SK_BowPressure_' was not declared in this scope /Users/morganpackard/Desktop/trashme/StkCompile/../../../Data/study/iPhone class/stk-4.4.2/src/BandedWG.cpp:342: error: '__SK_AfterTouch_Cont_' was not declared in this scope /Users/morganpackard/Desktop/trashme/StkCompile/../../../Data/study/iPhone class/stk-4.4.2/src/BandedWG.cpp:349: error: '__SK_ModWheel_' was not declared in this scope /Users/morganpackard/Desktop/trashme/StkCompile/../../../Data/study/iPhone class/stk-4.4.2/src/BandedWG.cpp:357: error: '__SK_ModFrequency_' was not declared in this scope /Users/morganpackard/Desktop/trashme/StkCompile/../../../Data/study/iPhone class/stk-4.4.2/src/BandedWG.cpp:359: error: '__SK_Sustain_' was not declared in this scope /Users/morganpackard/Desktop/trashme/StkCompile/../../../Data/study/iPhone class/stk-4.4.2/src/BandedWG.cpp:363: error: '__SK_Portamento_' was not declared in this scope /Users/morganpackard/Desktop/trashme/StkCompile/../../../Data/study/iPhone class/stk-4.4.2/src/BandedWG.cpp:367: error: '__SK_ProphesyRibbon_' was not declared in this scope

    Read the article

  • a macro question for c language (#define)

    - by Daniel
    I am reading source code of hoard memory allocator, and in the file of gnuwrapper.cpp, there are the following code #define CUSTOM_MALLOC(x) CUSTOM_PREFIX(malloc)(x) What's the meaning of CUSTOM_PREFIX(malloc)(x)? is CUSTOM_PREFIX a function? But as a function it didn't defined anywhere. If it's variable, then how can we use variable like var(malloc)(x)? more code: #ifndef __GNUC__ #error "This file requires the GNU compiler." #endif #include <string.h> #include <stdlib.h> #include <stdio.h> #include <malloc.h> #ifndef CUSTOM_PREFIX ==> here looks like it's a variable, so if it doesn't define, then define here. #define CUSTOM_PREFIX #endif #define CUSTOM_MALLOC(x) CUSTOM_PREFIX(malloc)(x) ===> what's the meaning of this? #define CUSTOM_FREE(x) CUSTOM_PREFIX(free)(x) #define CUSTOM_REALLOC(x,y) CUSTOM_PREFIX(realloc)(x,y) #define CUSTOM_MEMALIGN(x,y) CUSTOM_PREFIX(memalign)(x,y)

    Read the article

  • Scheme define/lambda shorthand

    - by incrediman
    In Scheme, how can I make use of the define/lambda shorthand for nested lambda expressions within my define? For example given the following procedure... (define add (lambda (num1 num2) (+ num1 num2))) One can shorten it to this: (define (add num1 num2) (+ num1 num2)) However, how can I shorten the following function similarly ? (define makeOperator (lambda (operator) (lambda (num1 num2) (operator num1 num2)))) ;example useage - equivalent to (* 3 4): ((makeOperator *) 3 4)

    Read the article

  • c++ macros question

    - by rabidmachine9
    can somebody explain the following code please? #if 1 // loop type #define FOR_IS_FASTER 1 #define WHILE_IS_FASTER 0 // indexing type #define PREINCREMENT_IS_FASTER 1 #define POSTINCREMENT_IS_FASTER 0 #else // loop type #define FOR_IS_FASTER 1 #define WHILE_IS_FASTER 0 // indexing type #define PREINCREMENT_IS_FASTER 0 #define POSTINCREMENT_IS_FASTER 1 #endif #if PREINCREMENT_IS_FASTER #define ZXP(z) (*++(z)) #define ZX(z) (*(z)) #define PZ(z) (++(z)) #define ZP(z) (z) #define ZOFF (1) #elif POSTINCREMENT_IS_FASTER #define ZXP(z) (*(z)++) #define ZX(z) (*(z)) #define PZ(z) (z) #define ZP(z) ((z)++) #define ZOFF (0) #endif I can understand what the functions are doing but for example how does the pre-processor choose which ZXP will be execute if we call it later? What the 1 and 0 stand for? thanks in advance

    Read the article

  • Limit scope of #define

    - by Ujjwal Singh
    What is the correct strategy to limit the scope of #define and avoid unwarrented token collisions. In the following configuration: Main.c # include "Utility_1.h" # include "Utility_2.h" VOID Utility() // Was written without knowing of: Utility_1 & Utility_2 { const UINT ZERO = 0; } VOID Main() { ... } // Collision; for Line:5 Compiler does not indicate what replaced Utility_1.h # define ZERO "Zero" # define ONE "One" BOOL Utility_1(); Utility_2.h # define ZERO '0' # define ONE '1' BOOL Utility_2(); Utility_2.c # include "Utility_2.h" BOOL Utility_2() { // Using: ZERO & ONE } //Collision: Character Literal replaced with String {Edit} Note: This is supposed to be a generic quesition so do not limit yourself to enum or other defined types. i.e. What to do when: I MUST USE #define Please comment on my proposed solution below.. _

    Read the article

  • How to set a define inside other define

    - by João Madureira Pires
    Hi all! I'm developing a web application in jboss, seam, richfaces. I'm using a template(xhtml) as master page of all others and there i set two insert tags. <ui:insert name="head"/> <ui:insert name="body"/> The problem is that in pages that use this master page as template, the <ui:define name="head">...</ui:define> must be defined inside the <ui:define name="body">...</ui:define>. How can i do this? Basically, what i want is to do the following: <ui:define name="body">... <ui:define name="head"> <meta name="title" content="#{something.title}" /> </ui:define> ...</ui:define> the master page must return : <meta name="title" content="#{something.title}" /> on the <ui:insert name="head"/> Thanks in advance

    Read the article

  • Need help for this syntax: "#define LEDs (char *) 0x0003010"

    - by Noge
    I'm doing programming of a softcore processor, Nios II from Altera, below is the code in one of the tutorial, I manage to get the code working by testing it on the hardware (DE2 board), however, I could not understand the code. #define Switches (volatile char *) 0x0003000 #define LEDs (char *) 0x0003010 void main() { while (1) *LEDs = *Switches; } What I know about #define is that, it is either used to define a constant, or a macro, but why in the above code, there are casting like, (char *) 0x0003010, in #define? why the 2 constants, Switches and LEDs act like a variable instead of a constant? Thanks in advance !

    Read the article

  • C Preprocessor: #define in C... advice

    - by vikramtheone
    Hi Guys, I'm making a big C project and I have never come across a situation like this before so, I need your advice. What is your opinion? Is it okay to have the constants defined within conditional preprocessors like I have done below or you advise me to do this some other way? Any drawbacks if I do it this way? Regards Vikram #define NUM_OCTAVES_4 //#define NUM_OCTAVES_5 #ifdef NUM_OCTAVES_4 #define OCTAVES 4 const unsigned char borders [4] = {11, 26, 50, 98}; #elif NUM_OCTAVES_5 #define OCTAVES 5 const unsigned char borders [5] = {11, 26, 50, 98, 194}; #endif

    Read the article

  • #define and how to use them - C++

    - by ML
    Hi All, in a pre-compiled header if I do: #define DS_BUILD #define PGE_BUILD #define DEMO then in source I do: #if (DS_BUILD && DEMO) ---- code--- #elif (PGE_BUILD && DEMO) --- code--- #else --- code --- #endif Do I get an error that states: error: operator '&&' has no right operand I have never seen this before. I am using XCode 3.2, GCC 4.2 on OS X 10.6.3

    Read the article

  • Should I define a single "DataContext" and pass references to it around or define muliple "DataConte

    - by Nate Bross
    I have a Silverlight application that consists of a MainWindow and several classes which update and draw images on the MainWindow. I'm now expanding this to keep track of everything in a database. Without going into specifics, lets say I have a structure like this: MainWindow Drawing-Surface Class1 -- Supports Drawing DataContext + DataServiceCollection<T> w/events Class2 -- Manages "transactions" (add/delete objects from drawing) Class3 Each "Class" is passed a reference to the Drawing Surface so they can interact with it independently. I'm starting to use WCF Data Services in Class1 and its working well; however, the other classes are also going to need access to the WCF Data Services. (Should I define my "DataContext" in MainWindow and pass a reference to each child class?) Class1 will need READ access to the "transactions" data, and Class2 will need READ access to some of the drawing data. So my question is, where does it make the most sense to define my DataContext? Does it make sense to: Define a "global" WCF Data Service "Context" object and pass references to that in all of my subsequent classes? Define an instance of the "Context" for each Class1, Class2, etc Have each method that requires access to data define its own instance of the "Context" and use closures handle the async load/complete events? Would a structure like this make more sense? Is there any danger in keeping an active "DataContext" open for an extended period of time? Typical usecase of this application could range from 1 minute to 40+ minutes. MainWindow Drawing-Surface DataContext Class1 -- Supports Drawing DataServiceCollection<DrawingType> w/events Class2 -- Manages "transactions" (add/delete objects from drawing) DataServiceCollection<TransactionType> w/events Class3 DataServiceCollection<T> w/events

    Read the article

  • How to define an Integer bean in Struts 1.x

    - by ian_scho_es
    Hi. How do you instantiate an Integer bean, assigning a value, in the Struts 1.x framework? <bean:define id="index" type="java.lang.Integer" value="0"/> or <bean:define id="index" type="java.lang.Integer" value="${0}"/> Results in a: java.lang.ClassCastException: java.lang.String <bean:define id="index" type="java.lang.Integer" value="<%=0%>"/> Results in: The method setValue(String) in the type DefineTag is not applicable for the arguments (int) <% java.lang.Integer index = new java.lang.Integer(0); %> Works, but makes my eyes bleed. Note that I had to refactor iterating over a list but am now applying a filter within the iteration. This was the cleanest solution of all! <logic:equal name="aplicacion" property="generico" value="false" indexId="index"> Maybe I need to go about this completely differently. Many thanks.

    Read the article

  • for loop in #define

    - by hspim
    #include <stdio.h> #define UNITS {'*', '#', '%', '!', '+', '$', '=', '-'} #define PrintDigit(c, d) (for (i=0; i < c ; i++)putchar(unit[d]);) char unit[] = UNITS; //void PrintDigit(c, element) { // int i; // for (i=0; i < c ; i++) // putchar(unit[element]); //} int main( ) { int i, element=4; PrintDigit(10, element); putchar('\n'); return 0; } I have the function here PrintDigit() which works as expected. When attempting to turn the function into a #define however gcc keeps throwing a syntax error on the for loop. Any idea what the problem is?

    Read the article

  • how this scaling down for css code is worked?

    - by harris
    this is a code for scaling down for css. i was wondering, how this worked. please someone explain to me part by part. thank you very much. /* ======================================================================== / / Copyright (C) 2000 - 2009 ND-Tech. Co., Ltd. / / All Rights Reserved. / / ======================================================================== / / Project : ScaleDown Created : 31-AUG-2009 / / File : main.c Contact : [email protected] / / ======================================================================== / / You are free to use or modify this code to the following restrictions: / / Acknowledge ND Tech. Co. Ltd. / / Or, put "Parts of code by ND Tech. Co., Ltd." / / Or, leave this header as it is. / / in somewhere in your code. / / ======================================================================== */ include "vm3224k.h" define CE0CTL *(volatile int *)(0x01800008) define CE2CTL *(volatile int *)(0x01800010) define SDCTL *(volatile int *)(0x01800018) define LED *(volatile short *)(0x90080000) // Definitions for async access(change as you wish) define WSU (2<<28) // Write Setup : 0-15 define WST (8<<22) // Write Strobe: 0-63 define WHD (2<<20) // Write Hold : 0-3 define RSU (2<<16) // Read Setup : 0-15 define TA (3<<14) // Turn Around : 0-3 define RST (8<<8) // Read Strobe : 0-63 define RHD (2<<0) // Read Hold : 0-3 define MTYPE (2<<4) /* EDMA Registers */ define PaRAM_OPT 0 // Options define PaRAM_SRC 1 // Source Address define PaRAM_CNT 2 // Frame count, Element count define PaRAM_DST 3 // Destination Address define PaRAM_IDX 4 // Frame index, Element index define PaRAM_RDL 5 // Element count reload, Link address define EDMA_CIPR *(volatile int *)0x01A0FFE4 // EDMA Channel interrupt pending low register define EDMA_CIER *(volatile int *)0x01A0FFE8 // EDMA Channel interrupt enable low register define EDMA_CCER *(volatile int *)0x01A0FFEC // EDMA Channel chain enable register define EDMA_ER *(volatile int *)0x01A0FFF0 // EDMA Event low register define EDMA_EER *(volatile int *)0x01A0FFF4 // EDMA Event enable low register define EDMA_ECR *(volatile int *)0x01A0FFF8 // EDMA Event clear low register define EDMA_ESR *(volatile int *)0x01A0FFFC // EDMA Event set low register define PRI (2<<29) // 1:High priority, 2:Low priority define ESIZE (1<<27) // 0:32bit, 1:16bit, 2:8bit, 3:reserved define DS2 (0<<26) // 1:2-Dimensional define SUM (0<<24) // 0:no update, 1:increment, 2:decrement, 3:by index define DD2 (0<<23) // 1:2-Dimensional define DUM (0<<21) // 0:no update, 1:increment, 2:decrement, 3:by index define TCINT (1<<20) // 0:disable, 1:enable define TCC (8<<16) // 4 bit code define LINK (0<<1) // 0:disable, 1:enable define FS (1<<0) // 0:element, 1:frame define OptionField_0 (PRI|ESIZE|DS2|SUM|DD2|DUM|TCINT|TCC|LINK|FS) define DD2_1 (1<<23) // 1:2-Dimensional define DUM_1 (1<<21) // 0:no update, 1:increment, 2:decrement, 3:by index define TCC_1 (9<<16) // 4 bit code define OptionField_1 (PRI|ESIZE|DS2|SUM|DD2_1|DUM_1|TCINT|TCC_1|LINK|FS) define TCC_2 (10<<16)// 4 bit code define OptionField_2 (PRI|ESIZE|DS2|SUM|DD2|DUM|TCINT|TCC_2|LINK|FS) define DS2_3 (1<<26) // 1:2-Dimensional define SUM_3 (1<<24) // 0:no update, 1:increment, 2:decrement, 3:by index define TCC_3 (11<<16)// 4 bit code define OptionField_3 (PRI|ESIZE|DS2_3|SUM_3|DD2|DUM|TCINT|TCC_3|LINK|FS) pragma DATA_SECTION ( lcd,".sdram" ) pragma DATA_SECTION ( cam,".sdram" ) pragma DATA_SECTION ( rgb,".sdram" ) pragma DATA_SECTION ( u,".sdram" ) extern cregister volatile unsigned int IER; extern cregister volatile unsigned int CSR; short camcode = 0x08000; short lcdcode = 0x00000; short lcd[2][240][320]; short cam[2][240][320]; short rgb[64][32][32]; short bufsel; int *Cevent,*Levent,*CLink,flag=1; unsigned char v[240][160],out_y[120][160]; unsigned char y[240][320],out_u[120][80]; unsigned char u[240][160],out_v[120][80]; void PLL6713() { int i; // CPU Clock Input : 50MHz *(volatile int *)(0x01b7c100) = *(volatile int *)(0x01b7c100) & 0xfffffffe; for(i=0;i<4;i++); *(volatile int *)(0x01b7c100) = *(volatile int *)(0x01b7c100) | 0x08; *(volatile int *)(0x01b7c114) = 0x08001; // 50MHz/2 = 25MHz *(volatile int *)(0x01b7c110) = 0x0c; // 25MHz * 12 = 300MHz *(volatile int *)(0x01b7c118) = 0x08000; // SYSCLK1 = 300MHz/1 = 300MHz *(volatile int *)(0x01b7c11c) = 0x08001; // SYSCLK2 = 300MHz/2 = 150MHz // Peripheral Clock *(volatile int *)(0x01b7c120) = 0x08003; // SYSCLK3 = 300MHz/4 = 75MHz // SDRAM Clock for(i=0;i<4;i++); *(volatile int *)(0x01b7c100) = *(volatile int *)(0x01b7c100) & 0xfffffff7; for(i=0;i<4;i++); *(volatile int *)(0x01b7c100) = *(volatile int *)(0x01b7c100) | 0x01; } unsigned short ybr_565(short y,short u,short v) { int r,g,b; b = y + 1772*(u-128)/1000; if (b<0) b=0; if (b>255) b=255; g = y - (344*(u-128) + 714*(v-128))/1000; if (g<0) g=0; if (g>255) g=255; r = y + 1402*(v-128)/1000; if (r<0) r=0; if (r>255) r=255; return ((r&0x0f8)<<8)|((g&0x0fc)<<3)|((b&0x0f8)>>3); } void yuyv2yuv(char *yuyv,char *y,char *u,char *v) { int i,j,dy,dy1,dy2,s; for (j=s=dy=dy1=dy2=0;j<240;j++) { for (i=0;i<320;i+=2) { u[dy1++] = yuyv[s++]; y[dy++] = yuyv[s++]; v[dy2++] = yuyv[s++]; y[dy++] = yuyv[s++]; } } } interrupt void c_int06(void) { if(EDMA_CIPR&0x800){ EDMA_CIPR = 0xffff; bufsel=(++bufsel&0x01); Cevent[PaRAM_DST] = (int)cam[(bufsel+1)&0x01]; Levent[PaRAM_SRC] = (int)lcd[(bufsel+1)&0x01]; EDMA_ESR = 0x80; flag=1; } } void main() { int i,j,k,y0,y1,v0,u0; bufsel = 0; CSR &= (~0x1); PLL6713(); // Initialize C6713 PLL CE0CTL = 0xffffbf33;// SDRAM Space CE2CTL = (WSU|WST|WHD|RSU|RST|RHD|MTYPE); SDCTL = 0x57115000; vm3224init(); // Initialize vm3224k2 vm3224rate(1); // Set frame rate vm3224bl(15); // Set backlight VM3224CNTL = VM3224CNTL&0xffff | 0x2; // vm3224 interrupt enable for (k=0;k<64;k++) // Create RGB565 lookup table for (i=0;i<32;i++) for (j=0;j<32;j++) rgb[k][i][j] = ybr_565(k<<2,i<<3,j<<3); Cevent = (int *)(0x01a00000 + 24 * 7); Cevent[PaRAM_OPT] = OptionField_0; Cevent[PaRAM_SRC] = (int)&camcode; Cevent[PaRAM_CNT] = 1; Cevent[PaRAM_DST] = (int)&VM3224ADDH; Cevent = (int *)(0x01a00000 + 24 * 8); Cevent[PaRAM_OPT] = OptionField_1; Cevent[PaRAM_SRC] = (int)&VM3224DATA; Cevent[PaRAM_CNT] = (239<<16)|320; Cevent[PaRAM_DST] = (int)cam[bufsel]; Cevent[PaRAM_IDX] = 0; Levent = (int *)(0x01a00000 + 24 * 9); Levent[PaRAM_OPT] = OptionField_2; Levent[PaRAM_SRC] = (int)&lcdcode; Levent[PaRAM_CNT] = 1; Levent[PaRAM_DST] = (int)&VM3224ADDH; Levent = (int *)(0x01a00000 + 24 * 10); Levent[PaRAM_OPT] = OptionField_3; Levent[PaRAM_SRC] = (int)lcd[bufsel]; Levent[PaRAM_CNT] = (239<<16)|320; Levent[PaRAM_DST] = (int)&VM3224DATA; Levent[PaRAM_IDX] = 0; IER = IER | (1<<6)|3; CSR = CSR | 0x1; EDMA_CCER = (1<<8)|(1<<9)|(1<<10); EDMA_CIER = (1<<11); EDMA_CIPR = 0xffff; EDMA_ESR = 0x80; while (1) { if(flag) { // LED = 0; yuyv2yuv((char *)cam[bufsel],(char *)y,(char *)u,(char *)v); for(j=0;j<240;j++) for(i=0;i<320;i++) lcd[bufsel][j][i]=0; for(j=0;j<240;j+=2) for(i=0;i<320;i+=2) out_y[j>>1][i>>1]=(y[j][i]+y[j][i+1]+y[j+1][i]+y[j+1][i+1])>>2; for(j=0;j<240;j+=2) for(i=0;i<160;i+=2) { out_u[j>>1][i>>1]=(u[j][i]+u[j][i+1]+u[j+1][i]+u[j+1][i+1])>>2; out_v[j>>1][i>>1]=(v[j][i]+v[j][i+1]+v[j+1][i]+v[j+1][i+1])>>2; } for (j=0;j<120;j++) for (i=0;i<160;i+=2) { y0 = out_y[j][i]>>2; u0 = out_u[j][i>>1]>>3; v0 = out_v[j][i>>1]>>3; y1 = out_y[j][i+1]>>2; lcd[bufsel][j+60][i+80]=rgb[y0][u0][v0]; lcd[bufsel][j+60][i+81]=rgb[y1][u0][v0]; } flag=0; // LED = 1; } } }

    Read the article

  • Understanding a #define directive

    - by Meta
    Looking at the Windows SDK, I found this #define directive for MAKEINTRESOURCEW: #define MAKEINTRESOURCEW(i) ((LPWSTR)((ULONG_PTR)((WORD)(i)))) Can someone explain to me what the heck that means? For example, what would be the value of MAKEINTRESOURCEW(0)? (1)? (-1)?

    Read the article

  • value of c define changes unexpectedly

    - by NomeN
    I have a lot of #define's in my code. Now a weird problem has crept up. I have this: #define _ImmSign 010100 (I'm trying to simulate a binary number) Obviously, I expect the number to become 10100. But when I use the number it has changed into 4160. What is happening here? And how do I stop it?

    Read the article

  • Template function in define

    - by Ockonal
    Hello, I have some template function and I want to call it using define in c++: #define CONFIG(key, type, def) getValue<type>(key, def); Of course, it won't work. Could I make something like this?

    Read the article

  • View Word Definitions in IE 8 with the Define with Bing Accelerator

    - by Asian Angel
    Do you need an easy way to view word definitions while browsing with Internet Explorer? The Define with Bing Accelerator will display definitions in the same (or a new) tab and save you time while browsing. Using Define with Bing The installation consists of two steps. First, click on Add to Internet Explorer to start the process. Next you will be asked to confirm the installation. Once you have clicked Add your new accelerator is ready to use (no browser restart required). Whenever you encounter a word that needs defining highlight it, click on the small blue square, go to All Accelerators, and then Define with Bing. There are two ways to access the definition: Hover your mouse over the Define with Bing text to open a small popup window Click on Define with Bing to open a definition search in a new tab Being able to access a definition or explanation in the same tab will definitely save you time while browsing. In the example shown here you can get an idea of what SCORM means but clicking on the links inside the popup window is not recommended (webpage opens in popup and is not resizable). In the situation shown above it is better to click on Define with Bing and see more information in a new tab. Conclusion The Define with Bing Accelerator can be a very useful time saver while browsing with Internet Explorer. Finding those word definitions will be a much more pleasant experience now. Add the Define with Bing Accelerator to Internet Explorer Similar Articles Productive Geek Tips Add Google Dictionary Power to ChromeChoose Custom New Tab Pages in ChromeSearch Alternative Search Engines from within Bing’s Search PageView Word Definitions in Google Chrome with DictionaryTipThe New Bing Bar Provides Easy Access to Searches and Microsoft Live Services TouchFreeze Alternative in AutoHotkey The Icy Undertow Desktop Windows Home Server – Backup to LAN The Clear & Clean Desktop Use This Bookmarklet to Easily Get Albums Use AutoHotkey to Assign a Hotkey to a Specific Window Latest Software Reviews Tinyhacker Random Tips CloudBerry Online Backup 1.5 for Windows Home Server Snagit 10 VMware Workstation 7 Acronis Online Backup Sculptris 1.0, 3D Drawing app AceStock, a Tiny Desktop Quote Monitor Gmail Button Addon (Firefox) Hyperwords addon (Firefox) Backup Outlook 2010 Daily Motivator (Firefox)

    Read the article

  • wonder about some #define tricks

    - by kingkai
    Whlie reading codes of my group project, I come across many DEFINEs, and some of them seems strange. To generalize it, please look at the following 2 examples. Example 1: #define SNPRINTF(dst, fmt, arg...) snprintf(dst, sizeof(dst), fmt, ##arg) what does "##" means in this circumstance? I've tried to delete both of them, and write codes like "char buf[1024]; SNPRINTF(buf,"%s,%s","abcd","efg");" which produced the same result. So "##" seems no use and no harm to me. Example 2: #define CLOSE(fd) do { \ if (-1 != (fd)) { \ close(fd); \ (fd) = -1; \ } \ } while (0) Necessary to stuff the inner code to the do{}while(0) statement? what's the use? Thanks!

    Read the article

  • Structs inside #define in C++

    - by Adam Smith
    Being pretty new to C++, I don't quite understand some instructions I encounter such as: #ifndef BOT_H_ #define BOT_H_ #include "State.h" /* This struct represents your bot in the game of Ants */ struct Bot { State state; Bot(); void playGame(); //plays a single game of Ants void makeMoves(); //makes moves for a single turn void endTurn(); //indicates to the engine that it has made its moves }; #endif //BOT_H_ What I don't understand is the "#ifndef BOT_H_" and the "#define -- #endif" From what I gather, it defines a constant BOT_H_ if it's not already defined when the precompiler looks at it. I don't actually get how the struct inside it is a constant and how it is going to let me access the functions inside it. I also don't see why we're doing it this way? I used C++ a while back and I wasn't using .h files, so it might be something easy I'm missing.

    Read the article

  • c++: use a #define in printf?

    - by John
    I was wanting to use a constant of some kind for the application ID (so I can use it in printf). I had this: #define _APPID_ "Hello World!" And then the simple printf, calling it into %s (string). It put this out: simple.cpp:32: error: cannot convert ‘_IO_FILE*’ to ‘const char*’ for argument ‘1’ to ‘int printf(const char*, ...)’ What would I use to define the application ID to use in printf? I tried: static const char _APPID_[] = "Hello World"` but it didn't work, same error I think.

    Read the article

  • Define data members within constructor

    - by bertsisterwanda
    I have got this little snippet of code, I want to be able to define each array element as a new data member. class Core_User { protected $data_memebers = array( 'id' = '%d', 'email' = '"%s"', 'password' = '"%s"', 'title' = '"%s"', 'first_name' = '"%s"', 'last_name' = '"%s"', 'time_added' = '%d' , 'time_modified' = '%d' , ); function __construct($id = 0, $data = NULL) { foreach($data_memebers as $member){ //protected new data member } }

    Read the article

  • #Define's scope throughout library?

    - by Mohit Deshpande
    Say I have a constant: #define PI 3.14 Say I have a static library with multiple header and source files. If I declare this in the header file, will its scope apply to all of the source files? Or do the source files need to include the header with the declaration of PI?

    Read the article

  • static, define, and const in C

    - by yCalleecharan
    Hi, I've read that static variables are used inside function when one doesn't want the variable value to change/initialize each time the function is called. But what about defining a variable static in the main program before "main" e.g. #include <stdio.h> static double m = 30000; int main(void) { value = m * 2 + 3; } Here the variable m has a constant value that won't get modified later in the main program. In the same line of thought what difference does it make to have these instead of using the static definition: const double m = 30000; or #define m 30000 //m or M and then making sure here to use double operations in the main code so as to convert m to the right data type. Thanks a lot...

    Read the article

  • C - add elements to struct by define

    - by CodeStepper
    I have a problem. I'm trying to add struct elements by previously defined constant. This is sample code (OpenGL+WinAPI) #define ENGINE_STRUCT \ HGLRC RenderingContext;\ HDC DeviceContext; And then: typedef struct SWINDOW { ENGINE_STRUCT HWND Handle; HINSTANCE Instance; CHAR* ClassName; BOOL Fullscreen; BOOL Active; MSG Message; } WINDOW; Is this possible? Thanks in advance.

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >