Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
mracer
Feb 23, 2004
The M racer
Ok, more of a Visual Studio question. Whats the best way to step thru code with many macros. you know #define functions.

for example:
code:
#define COPY_PMV(adst,asrc) {                      \
  Ipp32s nn;                                       \
  for(nn=0; nn<sizeof(adst)/sizeof(Ipp32s); nn++)  \
    ((Ipp32s*)adst)[nn] = ((Ipp32s*)asrc)[nn];     \
}
is there an option for the debugger to show that instead of COPY_PMV(pointer,pointer) ?

Adbot
ADBOT LOVES YOU

mracer
Feb 23, 2004
The M racer

more falafel please posted:

This will work if adst is an array, but not if it's a pointer (and not if it's an array that's degraded to a pointer in the current scope).

First off, you should use memcpy() or std::copy (if C++), because they're generally optimized beyond what you're going to write.

But if you want to debug this, I would suggest putting printfs/couts/however you log in the macro itself.
code:
#define COPY_PMV(adst,asrc) {                      \
  Ipp32s nn;                                       \
  for(nn=0; nn<sizeof(adst)/sizeof(Ipp32s); nn++)  \
  { \
    printf("nn=%d &(adst[nn])=%p &(asrc[nn])=%p asrc[nn]=%d\n", nn, &(adst[nn]), &(asrc[nn]), asrc[nn]); \
    ((Ipp32s*)adst)[nn] = ((Ipp32s*)asrc)[nn];     \
  } \
}

I know that this macro doesn't look optimize. (the goal of video encoding is to confuse :) ) But Intel loves to put them throughout their code. I didn't write the code but if i did i would inline and such. This was just one of the basic ones so i used it as an example. I think i will though take the printf advice and use it. thank you.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply