🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #4707

Code short circuit

#4707
From: Bruce Salzman
Date: Tue, 06 Dec 2005 23:11
26 lines
1609 bytes
The following constants are defined in winuser.h:
#define SC_SIZE         0xF000
#define SC_MOVE         0xF010
#define SC_MINIMIZE     0xF020
#define SC_MAXIMIZE     0xF030
#define SC_CLOSE        0xF060

When I compile this code, all the case statments are optimized away 
(cmd is a uint passed to a windows message handler):

        switch (cmd & 0xFFF0)
        {
            case SC_MAXIMIZE:
            case SC_RESTORE:
            case SC_MINIMIZE:
            case SC_MOVE:
            case SC_SIZE:
                 return;
            default:
                 break;
        }

Does anyone see why? Even removing the '& 0xFFF0' doesn't matter.

-- 
Bruce 
Technical Details
Message-ID: <43961a6f@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!news-out.newsfeeds.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,c4f5899a764a1e0,start
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: " Bruce Salzman" <bruce@nospam.org>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Code short circuit
Date: Tue, 6 Dec 2005 17:11:37 -0600
Lines: 28
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
NNTP-Posting-Host: 67.52.3.150
Message-ID: <43961a6f@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1133910639 67.52.3.150 (6 Dec 2005 15:10:39 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!news-out.newsfeeds.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail