flags

Where to add -Wall and -Wextra in Xcode 3.1.4

I'm trying to figure out where to add extra warning flags like -Wall and -Wextra in Xcode, I'm using version 3.1.4 on Leopard. Apple's documentation is for an old version, if I follow their instructions it takes me to a completely different window than what they show. Also they have a screenshot of a checklist of specific warning flags...

How to force Python to ignore re.DOTALL in re.findall() statement?

I have been banging my head against the keyboard in search of enlightenment through Google and all Python docs I could get my hands on, but could not find an answer to an issue I'm encountering. I have the following regex that I run against a website, but Python insists in setting re.DOTALL on it, even though my code does not tell it to...

How do I use low-level 8 bit flags as conditionals?

In my keyboard hook, each keypress gets a flag that states if it was injected or not. http://msdn.microsoft.com/en-us/library/ms644967(VS.85).aspx I've distilled a KBDLLHOOKSTRUCT from the lParam. I can access kbd.flags.XXX. I just don't know how to convert this 8bit flag into an if (injected) {... type conditional that I know how to u...

recv() functions flag for taking the while buffer in one string [windows C]

This code sends and recv s txt file perfectly but cannot do it to otehr formats like .exe or .img. Please help me with these as I need to use htonl or htons?? Take a look!! Here is the server side recv function :: if (socket_type != SOCK_DGRAM) { fi = fopen (final,"wb"); retval = recv(msgsock, ...

.Net Serialization, XmlDataReader, a SQL Database and the FlagsAttribute!

Giving a quick overview of my situation: I am working on an N-Tier app that relies a lot on serialization, objects interact with the database mainly in a serialized fashion, objects and collections are inserted, updated and read as XML from within stored procedures. For some of the smaller data classes I am simply using ExecuteNonQuery...

Multiple ways to define C# Enums with [Flags] attribute?

I understand how Enums work in C#, and I get what the Flags attribute brings to the table. I saw this question, here. Which recommends the first flavor, but doesn't provide any reason/justification for it. Is there a difference in the way in which these two are defined, is one better than the other? What are the advantages to using the...

Storing EnumSet in a database?

So in C++/C# you can create flags enums to hold multiple values, and storing a single meaningful integer in the database is, of course, trivial. In Java you have EnumSets, which appear to be quite a nice way to pass enums around in memory, but how do you output the combined EnumSet to an integer for storage? Is there another way to appr...

GCC option that can cause trouble when debugging with GDB

Hi all, I was wondering if I can get a list of gcc option that can cause gdb to behave strange. Of course, we all know that using optimization options (-O3 for instance) causes weird behaviour in gdb, but what are the other options that can have such impact? (I'm currently trying to run an mpeg2 decoder in gdb and I get weird behaviou...

In GCC-style extended inline asm, is it possible to output a "virtualized" boolean value, e.g. the carry flag?

If I have the following C++ code to compare two 128-bit unsigned integers, with inline amd-64 asm: struct uint128_t { uint64_t lo, hi; }; inline bool operator< (const uint128_t &a, const uint128_t &b) { uint64_t temp; bool result; __asm__( "cmpq %3, %2;" "sbbq %4, %1;" "setc %0;" : // outp...

How do I determine if an Enum value has one or more of the values it's being compared with?

I've got an Enum marked with the [Flags] attribute as follows: [Flags] public enum Tag : int { None = 0, PrimaryNav = 1, HideChildPages = 2, HomePage = 4, FooterLink = 8 } On sitemapnodes in my sitemap I store the int value for the tags combination as an attribute. What I need to do is check if a node has any on...

How to make Qt::Tool not stay on top of the main window.

I have problem with Qt::Tool flag. When I create new widget with Qt::Tool flag it appears on top of the main window. But when I switch back to main window and make it active the I still have the tool widget in front so it my main window is not fully visible. Qt::WindowStaysOnTopHint is not active. Just in case - environment is KDE4 Th...

How do I automatically reset a boolean when any method other is called in C#?

Hey everyone, Using C#, I need to do some extra work if function A() was called right before function C(). If any other function was called in between A() and C() then I don't want to do that extra work. Any ideas that would require the least amount of code duplication? I'm trying to avoid adding lines like flag = false; into every fun...

C# Flag Enum delimiter

I have an Enum and member it type [Flags] public enum SearchFilter { types = 0x01, attributes = 0x02, methods = 0x04 } [System.Xml.Serialization.XmlAttribute("search-filter")] public SearchFilter search_filter = SearchFilter.types | SearchFilter.attributes | SearchFilter.methods; when serialize this class result attr...

Needs clarification on C# Flags

Hi guys, i have this code: [Flags] public enum MyUriType { ForParse, ForDownload, Unknown } and then: MyUriType uriType = MyUriType.ForDownload; but, I was wondering why this returns true: if ((uriType & MyUriType.ForParse) == MyUriType.ForParse) When it is not set in the second code group. Please advise. ...

Why aren't debugging symbols being added to my output file?

I am trying to compile a project to run on an ARM board that I have. To use the debugger, I have to put debugging symbols in the resulting .elf file. I configured everything and ran my makefile, which produced the following results: arm-elf-gcc -x assembler-with-cpp -c -mcpu=arm7tdmi-s -g -gdwarf-2 -Wa,-amhls=src/crt.lst src/crt.S -o...

Flag bit computation and detection

Hi all, In some code I'm working on I should take care of ten independent parameters which can take one of two values (0 or 1). This creates 2^10 distinct conditions. Some of the conditions never occur and can be left out, but those which do occur are still A LOT and making a switch to handle all cases is insane. I want to use 10 if ...

How to add flags to RC.EXE through QMake .pro makefiles

I've the following definition in my .pro file: RC_FILE = app.rc This RC file contains a global include at the top: #include "version_info.h" The version_info.h header is on a common header files directory. Since RC.EXE takes INCLUDE environment variable in consideration, according to MS documentation, my build process batch sets u...

Large flags enumerations in C#

Hey everyone, got a quick question that I can't seem to find anything about... I'm working on a project that requires flag enumerations with a large number of flags (up to 40-ish), and I don't really feel like typing in the exact mask for each enumeration value: public enum MyEnumeration : ulong { Flag1 = 1, Flag2 = 2, Flag...

How to query flags stored as enum in NHibernate

How to do either a HQL or a Criteria search (the latter is preferred) involving an enum that is used as flags. In other words, I have a persisted enum property that stores some kind of flags. I want to query all the records that have one of these flags set. Using Eq won't work of course because that will only be true, if that is the only...

Android full Screen flag gives an exception

In my android app I set this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN ); Then my touch screen event doesnt’ work any more. Further Explaining, I have a button and onClick it changes the contentView by setContentView(R.layout.choose_pla...