IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 4326


Ignore:
Timestamp:
Jun 20, 2005, 2:54:17 PM (21 years ago)
Author:
jhoblitt
Message:

factor out intermediate value variables where it doesn't impact readability

Location:
trunk/glueforge/templates/psdb
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/glueforge/templates/psdb/droptable.tt

    r4169 r4326  
    11bool [% namespace %]DropTable(psDB *dbh)
    22{
    3     bool            status;
    4 
    5     status = psDBDropTable(dbh, [% namespace FILTER upper %]_TABLE_NAME);
    6 
    7     return status;
     3    return psDBDropTable(dbh, [% namespace FILTER upper %]_TABLE_NAME);
    84}
  • trunk/glueforge/templates/psdb/droptable_c.tt

    r4169 r4326  
    1212    }
    1313
    14     if(![% namespace %]DropTable(dbh)) {
     14    if (![% namespace %]DropTable(dbh)) {
    1515        exit(EXIT_FAILURE);
    1616    }
  • trunk/glueforge/templates/psdb/init.tt

    r4169 r4326  
    11psDB *[% namespace %]Init(const char *host, const char *user, const char *passwd, const char *dbname)
    22{
    3     psDB            *dbh;
    4 
    5     dbh = psDBInit(host, user, passwd, dbname);
    6 
    7     return dbh;
     3    return psDBInit(host, user, passwd, dbname);
    84}
  • trunk/glueforge/templates/psdb/insert_c.tt

    r4196 r4326  
    88{
    99    psDB            *dbh;
    10     bool            status;
    1110
    1211    dbh = psDBInit("localhost", "test", NULL, "test");
     
    1514    }
    1615
    17     status = [% namespace %]Insert(dbh,
     16    if (![% namespace %]Insert(dbh,
    1817[%- SET i = 0 -%]
    1918[%- FOREACH item = columns -%]
    2019[%- IF i == 0 -%][%- i = 1 -%][%- ELSE -%], [% END -%] [%- item.test -%]
    2120[%- END -%]
    22 );
    23 
    24     if (!status) {
     21)) {
    2522        exit(EXIT_FAILURE);
    2623    }
  • trunk/glueforge/templates/psdb/insertobject.tt

    r4196 r4326  
    11bool [% namespace %]InsertObject(psDB *dbh, [% object_name %] *object)
    22{
    3     bool            status;
    4 
    5     status = [% namespace %]Insert(dbh,
     3    return [% namespace %]Insert(dbh,
    64[%- SET i = 0 -%]
    75[%- FOREACH item = columns -%]
     
    108[%- END -%]
    119);
    12 
    13     return status;
    1410}
  • trunk/glueforge/templates/psdb/insertobject_c.tt

    r4192 r4326  
    88{
    99    psDB            *dbh;
    10     bool            status;
    1110    [% indented(object_name, "*object") %];
    1211
     
    2625    }
    2726
    28     status = [% namespace %]InsertObject(dbh, object);
    29     if (!status) {
     27    if (![% namespace %]InsertObject(dbh, object)) {
    3028        exit(EXIT_FAILURE);
    3129    }
  • trunk/glueforge/templates/psdb/pop_c.tt

    r4163 r4326  
    88{
    99    psDB            *dbh;
    10     bool            status;
    1110[% FOREACH item = columns -%]
    1211[% IF item.ctype == "char*" -%]
     
    2221    }
    2322
    24     status = [% namespace %]Pop(dbh,
     23    if (![% namespace %]Pop(dbh,
    2524[%- SET i = 0 -%]
    2625[% FOREACH item = columns -%]
    2726[% IF i == 0 %][% i = 1 %][% ELSE %], [% END -%]
    2827&[% item.name -%]
    29 [% END %]);
    30     if (!status) {
     28[% END %])) {
    3129        exit(EXIT_FAILURE);
    3230    }
  • trunk/glueforge/templates/psdb/popobject.tt

    r4265 r4326  
    33[% object_name %] *[% namespace %]PopObject(psDB *dbh)
    44{
    5     bool            status;
    6     [% indented(object_name, "*object") %];
    75[% FOREACH item = columns -%]
    86[% IF item.type == "STR" -%]
     
    1311[% END -%]
    1412
    15     status = [% namespace %]Pop(dbh,
     13    if (![% namespace %]Pop(dbh,
    1614[%- SET i = 0 -%]
    1715[% FOREACH item = columns -%]
     
    2220&[% item.name -%]
    2321[% END -%]
    24 [% END %]);
    25     if (!status) {
     22[% END %])) {
    2623        // psError(); something bad happened
    2724        return NULL;
    2825    }
    2926
    30     object = [% object_name %]Alloc(
     27    return [% object_name %]Alloc(
    3128[%- SET i = 0 -%]
    3229[% FOREACH item = columns -%]
     
    3431[% item.name %]
    3532[%- END -%]);
    36 
    37     return object;
    3833}
Note: See TracChangeset for help on using the changeset viewer.