freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Devel] Caching


From: Zulfiqar Bashir
Subject: [Devel] Caching
Date: Mon, 7 Jun 2004 00:20:28 -0700 (PDT)

Hi, 
  I built free type 2.1.8 on my windows xp machince
using visual studio .Net. I experienced some problem
with the caching. After the first call to
"FTC_Manager_LookupSize" other calls does not make any
difference and i always get the character of same size
(size that was set in first call). 
I tried to debug the problem and following is my
observation:

Platform: Windows XP, Visual Studio.Net

On debugging i found the problem in "FTC_MruList_Find"
function in "ftcmru.c"

      do
      {
        
        if ( compare(node,key) )
        {
          if ( node != first )
            FTC_MruNode_Up( &list->nodes, node );

          return node;
        }

        node = node->next;

      } while ( node != first);

In above loop no matter what the compare(node,key)
returns, the control moves inside the if block and so
node = node -> next is never called. To debug the
problem i made following changes in the code.

 do
      {
                unsigned char tempuchar;
                int tempint1,tempint2;
    
                tempint1 =compare(node,key);  
                tempuchar=compare(node,key);
                tempint2=(unsigned char)compare(node,key);

        if ( tempuchar )
        {
          if ( node != first )
            FTC_MruNode_Up( &list->nodes, node );

          return node;
        }

        node = node->next;

      } while ( node != first);

Now when i step through the code, i notice this when
compare returns 1:

tempint1 is set to  : 20631809
tempuchar is set to : 1
tempint2 is set to  : 1

tempint2 and tempuchar always get the right value but
tempint1 always get some big positive value like
20631809.

So the problem is that while assigning the unsigned
char return value ( which is 1 or 0) to the intger on
functions's return, some thing goes wrong. The control
always goes inside the if block.

Another observation is that when compare function is
"FT_CALLBACK_DEF( FT_Bool )
  ftc_size_node_compare( FTC_SizeNode  node,
FTC_Scaler    scaler )" and return value is 1,
tempint1 is also set to correct value i.e 1. But when
it returns 0, tempint1 is set to some big positive
value. 

What could be wrong here? Am I missing some project
setting??


 FT_CALLBACK_DEF( FT_Bool )
  ftc_size_node_compare( FTC_SizeNode  node,
                         FTC_Scaler    scaler )

Regards,
zulfiqar


        
                
__________________________________
Do you Yahoo!?
Friends.  Fun.  Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/ 






reply via email to

[Prev in Thread] Current Thread [Next in Thread]