pspad:
--------------------------------------------------------------------------------
1, 2, 3: I am not C programmer. Source sample please

I guess many your problems coresponds to concrete PC configuration. Can you
write it please?
--------------------------------------------------------------------------------


It can be .. I did not reinstall everything for a long time .. so 2253 is just
the 5th or later update.

Here is a example file for the code explorer


/*================================================
   Code explorer flaws in PsPad 4.5.3 (2253)
================================================*/

/* regarding (1) */
#include <stdio.h>  /* ... for printf */
#include <string.h> // string operations

typedef enum { CALZONE, MARGERITHA } PizzaType;

/* regarding (3) */
/* its not a function declaration, it's a type */
typedef int(*CostFunctionPtrType)(void);

/* its a one-line declaration of a function */
int Coding(void);

/* regarding (2) declaration not in Prototypes*/
/* its a multi-line declaration of a function */
int buyPizza(int quantity,
             PizzaType kind);

int Breakfast(void)
{
    return 0;
}

/* regarding new: text appears which shouldnt? */
/* sometimes, C coders are lazy with lines :-) */
int Lunch(void) { return 0; }

int Coding(void)
{
    return 30;
}

/* this is an actual function */
int buyPizza(int quantity,
             PizzaType kind)
{
    if (!quantity)
    {
        printf("Is 0 what do you really want?\n");
    }
    else
    {
        printf("don't forget 4 SEASONS\n");
    }
    return quantity * 2;
}


/* should be a bug: the comments are not painted
   .. still not reproducible with this example */
#define NAMEOF(_data)                           \
/*repaint bug - get name of symbol */           \
    #_data                                      \
/*end ofmacro */


#define ASK_FOR_PIZZA(_data)                    \
/*repaint bug - get name of symbol */           \
    if (_data == CALZONE)                       \
    {                                           \
      printf("I Want my favorite %s\n", #_data);\
    }                                           \
    else                                        \
    {                                           \
      printf("I'd go for %s\n", #_data);        \
    }                                           \
    printf("order over\n\n");                   \
    ((void)0)                                   \
/* end ofmacro */


int main()
{
    int costs;
    CostFunctionPtrType meal;

    meal = &Breakfast;
    
    printf ("(macro test : %s)\n", NAMEOF(costs));

    ASK_FOR_PIZZA(CALZONE);
    costs = buyPizza((*meal)(), CALZONE);

    printf ("%s time, to pay for this: %d\n",
            NAMEOF(meal), costs);

    return 0;
}


-- 
<http://forum.pspad.com/read.php?6,37759,37952>
PSPad freeware editor http://www.pspad.com

Odpovedet emailem