Changeset: bcab3d85f448 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=bcab3d85f448
Modified Files:
        sql/backends/monet5/vaults/fits.c
        sql/backends/monet5/vaults/fits.mal
Branch: default
Log Message:

Adjustments of initializations, comments, spaces.


diffs (171 lines):

diff --git a/sql/backends/monet5/vaults/fits.c 
b/sql/backends/monet5/vaults/fits.c
--- a/sql/backends/monet5/vaults/fits.c
+++ b/sql/backends/monet5/vaults/fits.c
@@ -214,7 +214,7 @@
        int tm0, texportboolean=0, texportchar=0, texportstring=0, 
texportshort=0, texportint=0, texportlong=0, texportfloat=0, texportdouble=0;
        int numberrow = 0, cc = 0, status = 0, j = 0, columns, fid, dimension = 
0, block = 0;
        int boolcols = 0, charcols = 0, strcols = 0, shortcols = 0, intcols = 
0, longcols = 0, floatcols = 0, doublecols = 0;
-
+       int hdutype;
 
        char charvalue, *readcharrows;
        str strvalue; char **readstrrows;
@@ -224,7 +224,7 @@
        float realvalue, *readfloatrows;
        double doublevalue, *readdoublerows;
        _Bool boolvalue, *readboolrows;
-
+       struct list * set;
 
        msg = getContext(cntxt, mb, &m, NULL);
        if (msg)
@@ -240,25 +240,24 @@
                return msg;
        }
 
-       struct list * set = (*tbl).columns.set;
+       set = (*tbl).columns.set;
 
        columns = list_length(set);
        colname = (str *) GDKmalloc(columns * sizeof(str));
        tform = (str *) GDKmalloc(columns * sizeof(str));
-       
-       mnstr_printf(GDKout,"Number of columns: %d\n", columns);
-       
+
+       /*      mnstr_printf(GDKout,"Number of columns: %d\n", columns);*/
+
        tables = mvc_bind_table(m, sch, "_tables");
        col = mvc_bind_column(m, tables, "name");
        rid = table_funcs.column_find_row(m->session->tr, col, tname, NULL);
-               
+
        col = mvc_bind_column(m, tables, "id");
        fid = *(int*) table_funcs.column_find_value(m->session->tr, col, rid);
 
        column =  mvc_bind_table(m, sch, "_columns");
        col = mvc_bind_column(m, column, "table_id");
 
-
        rs = table_funcs.rids_select(m->session->tr, col, (void *) &fid, (void 
*) &fid, NULL);
 
        while ((rid = table_funcs.rids_next(rs)) != oid_nil)
@@ -266,14 +265,14 @@
                col = mvc_bind_column(m, column, "name");
                name = (char *) table_funcs.column_find_value(m->session->tr, 
col, rid);
                colname[j] = toLower(name);
-       
+
                col = mvc_bind_column(m, column, "type");
                type = (char *) table_funcs.column_find_value(m->session->tr, 
col, rid);
 
                if (strcmp(type,"boolean")==0) tform[j] = "1L";
 
-               if (strcmp(type,"char")==0) tform[j] = "1S";
-                       
+               if (strcmp(type,"char")==0) tform[j] = "1S";
+
                if (strcmp(type,"varchar")==0) tform[j] = "8A";
 
                if (strcmp(type,"smallint")==0) tform[j] = "1I";
@@ -281,7 +280,7 @@
                if (strcmp(type,"int")==0) tform[j] = "1J";
 
                if (strcmp(type,"bigint")==0) tform[j] = "1K";
-                       
+
                if (strcmp(type,"real")==0) tform[j] = "1E";
 
                if (strcmp(type,"double")==0) tform[j] = "1D";
@@ -289,7 +288,6 @@
                j++;
        }
 
-
        col = mvc_bind_column(m, tbl, colname[0]);
 
        nrows = store_funcs.count_col(col);
@@ -306,19 +304,18 @@
        fits_close_file(fptr, &status);
        fits_open_file(&fptr, filename, READWRITE, &status);
 
-       int hdutype;
        fits_movabs_hdu(fptr, 1, &hdutype, &status);
        fits_create_tbl( fptr, BINARY_TBL, 0, columns, colname, tform, NULL, 
tname, &status);
 
        for (cc = 0; cc < columns; cc++)
        {
+               char * columntype;
                col = mvc_bind_column(m, tbl, colname[cc]);
-
-               char * columntype = col -> type.type->sqlname;
+               columntype = col -> type.type->sqlname;
 
                if (strcmp(columntype,"boolean")==0)
                {
-                       boolcols++;dimension = 0; block = 0;
+                       boolcols++; dimension = 0; block = 0;
                        fits_get_rowsize(fptr,&optimal,&status);
                        readboolrows = (_Bool *) GDKmalloc (sizeof(_Bool) * 
optimal);
 
@@ -371,7 +368,7 @@
                        tm0 = GDKms();
                        fits_write_col(fptr, TBYTE, cc+1, (optimal*block)+1, 1, 
dimension, readcharrows, &status);
                        texportchar += GDKms() - tm0;
-                       GDKfree(readcharrows);  
+                       GDKfree(readcharrows);
                }
 
                if (strcmp(columntype,"varchar")==0)
@@ -400,7 +397,7 @@
                        tm0 = GDKms();
                        fits_write_col_str(fptr, cc+1, (optimal*block)+1, 1, 
dimension, readstrrows, &status);
                        texportstring += GDKms() - tm0;
-                       GDKfree(readstrrows); 
+                       GDKfree(readstrrows);
                }
 
                if (strcmp(columntype,"smallint")==0)
@@ -549,7 +546,7 @@
                }
        }
 
-       // print all the times that were needed to export each one of the 
columns 
+       /* print all the times that were needed to export each one of the 
columns
                
        mnstr_printf(GDKout, "\n\n");
        if (texportboolean > 0)         mnstr_printf(GDKout, "%d 
Boolean\tcolumn(s) exported in %d ms\n", boolcols,   texportboolean);
@@ -559,19 +556,14 @@
        if (texportint > 0)             mnstr_printf(GDKout, "%d 
Integer\tcolumn(s) exported in %d ms\n", intcols,    texportint);
        if (texportlong > 0)            mnstr_printf(GDKout, "%d 
Long\t\tcolumn(s) exported in %d ms\n",    longcols,   texportlong);
        if (texportfloat > 0)           mnstr_printf(GDKout, "%d 
Float\t\tcolumn(s) exported in %d ms\n",   floatcols,  texportfloat);
-       if (texportdouble > 0)          mnstr_printf(GDKout, "%d 
Double\tcolumn(s) exported in %d ms\n",  doublecols, texportdouble);   
+       if (texportdouble > 0)          mnstr_printf(GDKout, "%d 
Double\tcolumn(s) exported in %d ms\n",  doublecols, texportdouble);
+       */
 
        fits_close_file(fptr, &status);
        return msg;
 }
 
 
-
-
-       
-
-
-
 str FITSdir(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci)
 {
        str msg = MAL_SUCCEED;
diff --git a/sql/backends/monet5/vaults/fits.mal 
b/sql/backends/monet5/vaults/fits.mal
--- a/sql/backends/monet5/vaults/fits.mal
+++ b/sql/backends/monet5/vaults/fits.mal
@@ -39,7 +39,7 @@
 
 pattern export(tablename :str): void
 address FITSexportTable
-comment "Export a FITS table to a FITS file";
+comment "Export a table to a FITS file";
 
 
 
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to