~ubuntu-branches/ubuntu/vivid/tidy/vivid-updates

« back to all changes in this revision

Viewing changes to console/tidy.c

  • Committer: Bazaar Package Importer
  • Author(s): Jason Thomas
  • Date: 2005-10-20 10:26:07 UTC
  • mfrom: (0.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051020102607-ezcx81ght15xsjuj
Tags: 20051018-1
* New upstream release
  (closes: #333444)
* debian/tidy.install: added debian/tidy.conf /etc/tidy/
  (closes: #308883)
* debian/control: changed libtidy0 to libtidy-0.99-0
* updated manpage
  (closes: #224427)

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
  CVS Info :
10
10
 
11
11
    $Author: arnaud02 $ 
12
 
    $Date: 2005/04/14 14:51:01 $ 
13
 
    $Revision: 1.34 $ 
 
12
    $Date: 2005/07/22 15:57:10 $ 
 
13
    $Revision: 1.38 $ 
14
14
*/
15
15
 
16
16
#include "tidy.h"
64
64
                           const char *c1, const char *c2 )
65
65
{
66
66
    const char *pc1=c1, *pc2=c2;
67
 
    char *c1buf = malloc(l1+1);
68
 
    char *c2buf = malloc(l2+1);
 
67
    char *c1buf = (char *)malloc(l1+1);
 
68
    char *c2buf = (char *)malloc(l2+1);
69
69
 
70
70
    do
71
71
    {
83
83
                           const char *c1, const char *c2, const char *c3 )
84
84
{
85
85
    const char *pc1=c1, *pc2=c2, *pc3=c3;
86
 
    char *c1buf = malloc(l1+1);
87
 
    char *c2buf = malloc(l2+1);
88
 
    char *c3buf = malloc(l3+1);
 
86
    char *c1buf = (char *)malloc(l1+1);
 
87
    char *c2buf = (char *)malloc(l2+1);
 
88
    char *c3buf = (char *)malloc(l3+1);
89
89
 
90
90
    do
91
91
    {
274
274
    if (pos->name3)
275
275
        len += 2+strlen(pos->name3);
276
276
 
277
 
    name = malloc(len+1);
 
277
    name = (tmbstr)malloc(len+1);
278
278
    strcpy(name, pos->name1);
279
279
    if (pos->name2)
280
280
    {
310
310
            break;
311
311
        }
312
312
 
313
 
    escpName = malloc(len+1);
 
313
    escpName = (tmbstr)malloc(len+1);
314
314
    escpName[0] = '\0';
315
315
 
316
316
    aux[1] = '\0';
344
344
    {
345
345
        size_t len =  strlen(cmdopt_catname[cat].name);
346
346
        printf("%s\n", cmdopt_catname[cat].name );
347
 
        printf("%*.*s\n", len, len, helpul );
 
347
        printf("%*.*s\n", (int)len, (int)len, helpul );
348
348
        for( pos=cmdopt_defs; pos->name1; ++pos)
349
349
        {
350
350
            tmbstr name;
456
456
    case TidyMiscellaneous:
457
457
        return "misc";
458
458
    }
 
459
    fprintf(stderr, "Fatal error: impossible value for id='%d'.\n", id);
459
460
    assert(0);
460
461
    abort();
461
462
}
583
584
static
584
585
int cmpOpt(const void* e1_, const void *e2_)
585
586
{
586
 
    const TidyOption* e1 = e1_;
587
 
    const TidyOption* e2 = e2_;
 
587
    const TidyOption* e1 = (const TidyOption*)e1_;
 
588
    const TidyOption* e2 = (const TidyOption*)e2_;
588
589
    return strcmp(tidyOptGetName(*e1), tidyOptGetName(*e2));
589
590
}
590
591
 
747
748
        def = tidyOptGetNextPick( topt, &pos );
748
749
        len += strlen(def);
749
750
    }
750
 
    val = malloc(len+1);
 
751
    val = (tmbstr)malloc(len+1);
751
752
    val[0] = '\0';
752
753
    pos = tidyOptGetPickList( topt );
753
754
    first = yes;
768
769
{
769
770
    if (d->vals)
770
771
    {
771
 
        tmbstr val = malloc(1+strlen(d->vals));
 
772
        tmbstr val = (tmbstr)malloc(1+strlen(d->vals));
772
773
        strcpy(val, d->vals);
773
774
        return val;
774
775
    }