bug-indent
[Top][All Lists]
Advanced

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

[Bug-indent] indent 2.2.8 bugs and enhancement request [2nd request]


From: Richard A Painter
Subject: [Bug-indent] indent 2.2.8 bugs and enhancement request [2nd request]
Date: Mon, 20 Jan 2003 15:55:00 -0700

i have to report several problems with indent and also request 2 new options.

new option 1:

add an option to remove adjacent spaces withing the cast parens.  the result
would look like this (also using -ncs): (char *)voidptr





new option 2:

add an option to force a blank line BEFORE a procedure.  with the following code
(also using -psl -prs -npcs):
        /*
         * some comment block starting in col 1
         */

        int
        main(int argc, char *argv[])
        {

would format to the SAME line spacing.  in other words, it would preserve the
original blank line between the comment and the "int" procedure type.  if the
original did not have the blank line, one would be inserted.  the -prs will
insert additional spaces within the procedure ():
        /*
         * some comment block starting in col 1
         */

        int
        main( int argc, char *argv[] )
        {




problem 1, improper line aggregation:

regardless of the -ln setting (-l0, -l80, -l256) AND given these key options
-bbo -hnl the following is grossley reformatted from:

        sprintf( bufp, "%04d%09lu%04d%02d%02d%02d%02d%02d%03d%06u%04u%04d",
                tot_len,
                tp->terminal_id,
                today.tm_year + 1900,
                today.tm_mon+1,
                today.tm_mday,
                today.tm_hour,
                today.tm_min,
                today.tm_sec,
                (int)((now - (double)nowsec) * 1000.0),         // millisec
                tp->transaction_code,
                tp->response_code,
                tp->tq_size);


to:

        sprintf( bufp, "%04d%09lu%04d%02d%02d%02d%02d%02d%03d%06u%04u%04d", 
tot_len,
tp->terminal_id, today.tm_year + 1900, today.tm_mon + 1, today.tm_mday,
today.tm_hour, today.tm_min, today.tm_sec, ( int )( ( now - ( double )nowsec ) *
1000.0 ),       // millisec
                 tp->transaction_code, tp->response_code, tp->tq_size );




problem 2, function name and left paren are separated even when option -npcs

some function calls are broken between the function name and the left paren even
though -npcs is used.  original code:

                        ERROR( "read_ipc: %6.3f sec timeout on data timed read, 
msg read %d\n",
timeout, count );


results from indent:

                        ERROR
                                ( "read_ipc: %6.3f sec timeout on data timed 
read, msg read %d\n",
                                  timeout, count );







i have attached the indent profile i am using for your reference.  it was used
with the above problems too.

if you think the additional options would be easy then i would be willing to
tackle them.  i have not looked at the indent src in many, many years so i would
rely on your assessment of the difficulty.

thanks,
rich

-- 

+---------------------------------------------------------------+
| Richard A. Painter            Phone 719 495 7054              |
| Painter Engineering, Inc.     Mailto:address@hidden         |
| 8470 Swan Rd.                                                 |
| Black Forest, CO 80908                                        |
|                                                               |
| Visit our Web site:         http://painter.inc                |
|         http://home.earthlink.net/~painterengineering         |
|                                                               |
| Systems & Software Engineering + LAN WAN Networking + X.25    |
| INTERNET TCP-IP + Real-time Transaction Processing            |
| System & Software Integration, Testing, Verification & Audits |
| Web Hosting & Design + Apache + PHP + modSSL + cURL           |
| Database Design & Applications + Oracle                       |
| Benchmarks + Course & Workshop Development & Delivery         |
| Financial and Medical Software Integration + Security         |
| Middleware + EDI + Cryptography + Firewalls                   |
| UNIX + Linux + Windows                                        |
|                                                               |
| What is popular is not always right and what is right is not  |
| always popular.     - Howard Cosell                           |
|                                                               |
| Face it.  You have no privacy!   - Scott McNealy              |
|                                                               |
| Ned Ludd wasn't completely wrong!                             |
|                                                               |
| Chance favors the prepared mind!   Illegitima non carborundum |
+---------------------------------------------------------------+
//      .indent.pro - indent configuration
//
//      Rich Painter            Painter Engineering, Inc.
//      Aug 2002
//      Version 1.2
//
//      Note: set editor tab stops to 4 and shift width to 4

// blank lines
-bad    // blank after declare
-bap    // blank after procedure
-nbbb   // no force blank before boxed comment, keep if exists
-sob    // swallow optional blanks

// braces
-br             // brace at end of line
-ce             // cuddle else brace
-cdw    // cuddle do-while brace
-brs    // brace on struct line

// breaking
-bbo    // break before booleans
-nbc    // no comma break on declare
-hnl    // honor <nl> for breaking
-psl    // procedure type on preceding line

// comments
-cd33   // comment following declaration in col 33
-cdb    // comment delimiter on separate lines
-cp1    // 1 space after cpp directive before comment
-d0             // dont outdent comment ????
-lc80   // right margin col for comments to col 80
-sc             // * on edge of comment block
-nfc1   // dont format comments in col 1 (default)
-fca    // do format comments beginning after col 1

// indenting
// indent will use a real <tab> for all of these when they are all the same 
spacing (4)
-ts4    // tabs stops at 4 cols
-cli4   // case label indent to 4
-i4             // indent levels at 4 cols
-ci4    // continuation line indent to 4
-ip4    // old function args type declares indent to 4
-lp             // line up continuation on unmatched left {([

// spacing
-ss             // space separating empty line ; on for, while
-npcs   // no space between procedure and (  foo(
-ncs    // no space after cast operator
-prs    // force space around ( and )
-nsaf   // no space after for(
-nsai   // no space after if(
-nsaw   // no space after while(
-di1    // 1 space following type in declaration

// misc
//-pmt  // preserve file modifcation times
-l80    // non-comment line length

// what to do with these?
//-piN  // extra paren indentation on broken statement
//-sbiN // struct, enum brace indentation
//-bl           // indent left brace
//-bli8 // brace left indent cols to 8


reply via email to

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