Changeset 2288 for trunk/symbol_table


Ignore:
Timestamp:
Aug 9, 2012, 1:04:20 PM (7 years ago)
Author:
ksherdy
Message:

Removed problematic 'using namespace std;'

Location:
trunk/symbol_table
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/symbol_table/Makefile

    r2284 r2288  
    4242MAIN_OUTFILE=$(PABLO_OUT)/main.cpp
    4343
    44 # TEMPLATE=$(SYMBOL_TABLE_TEMPLATES_DIR)/main.template.cpp
    4544TEMP=t.tmp
    4645
     
    5756###########################################################################
    5857
    59 id: markers hash id_group $(MARKER_PABLO_SRC)
     58id: markers hash id_group
    6059        python $(PABLO_COMPILER) $(MARKER_PABLO_SRC) -t $(MAIN_OUTFILE) -l $(MARKER_PREFIX) -o $(MAIN_OUTFILE) $(PABLO_ADD_DEBUG)
    6160
    62 div2: markers hash div2_group $(MARKER_PABLO_SRC)
     61div2: markers hash div2_group
    6362        python $(PABLO_COMPILER) $(MARKER_PABLO_SRC) -t $(MAIN_OUTFILE) -l $(MARKER_PREFIX) -o $(MAIN_OUTFILE) $(PABLO_ADD_DEBUG)
    6463
    65 logbase2: markers hash logbase2_group $(MARKER_PABLO_SRC)
     64logbase2: markers hash logbase2_group
    6665        python $(PABLO_COMPILER) $(MARKER_PABLO_SRC) -t $(MAIN_OUTFILE) -l $(MARKER_PREFIX) -o $(MAIN_OUTFILE) $(PABLO_ADD_DEBUG)
    6766
    68 div2_logbase2: markers hash div2_logbase2_group $(MARKER_PABLO_SRC)
     67div2_logbase2: markers hash div2_logbase2_group
    6968        python $(PABLO_COMPILER) $(MARKER_PABLO_SRC) -t $(MAIN_OUTFILE) -l $(MARKER_PREFIX) -o $(MAIN_OUTFILE) $(PABLO_ADD_DEBUG)
    7069
    71 bit_byte: markers hash bit_byte_group $(MARKER_PABLO_SRC)
     70bit_byte: markers hash bit_byte_group
    7271        python $(PABLO_COMPILER) $(MARKER_PABLO_SRC) -t $(MAIN_OUTFILE) -l $(MARKER_PREFIX) -o $(MAIN_OUTFILE) $(PABLO_ADD_DEBUG)
    7372
  • trunk/symbol_table/src/gid.hpp

    r2278 r2288  
    44#include <simd-lib/bitblock.hpp>
    55#include <vector>
    6 using namespace std;
    76
    87typedef uint32_t gid_type;
     
    4443    } data;
    4544
    46     vector<data> values;
     45    std::vector<data> values;
    4746};
    4847
  • trunk/symbol_table/src/hash_table.hpp

    r2278 r2288  
    3535#include <sstream>
    3636#include <iostream>
    37 using namespace std;
    3837
    3938typedef struct node {
     
    7675        node * next = (node *) malloc(sizeof(node));
    7776        if (next == NULL) {
    78             cerr << "Out of Memory" << endl;
     77            std::cerr << "Out of Memory" << std::endl;
    7978            abort();
    8079        }
     
    183182
    184183        if ((table) == NULL) {
    185                 cerr << "Out of Memory" << endl;
     184                std::cerr << "Out of Memory" << std::endl;
    186185                abort();
    187186        }
     
    291290            node * crt = head;
    292291
    293             if(head != NULL) { cout << "table[" << i << "]"; }
     292            if(head != NULL) { std::cout << "table[" << i << "]"; }
    294293
    295294            while(crt != NULL) {
    296                 cout << "->";
     295                std::cout << "->";
    297296                print_node(crt);
    298297                crt = crt->next;
    299298            }
    300299
    301             if(head != NULL) { cout << endl; }
     300            if(head != NULL) { std::cout << std::endl; }
    302301        }
    303302    }
    304303
    305304    void print_node(node * crt) const {
    306         cout    << "(GID:"      << crt->gid
     305        std::cout       << "(GID:"      << crt->gid
    307306                << ",Lgth:"     << crt->raw_bytes_lgth
    308307                << ",Value:'"   << string((char *)&crt->raw_bytes[0], crt->raw_bytes_lgth)
     
    317316            node * crt = head;
    318317
    319             if(head != NULL) { cout << "table[" << i << "]"; }
     318            if(head != NULL) { std::cout << "table[" << i << "]"; }
    320319
    321320            while(crt != NULL) {
    322                 cout << "X";
     321                std::cout << "X";
    323322                crt = crt->next;
    324323            }
    325324
    326             if(head != NULL) { cout << endl; }
     325            if(head != NULL) { std::cout << std::endl; }
    327326        }
    328327    }
     
    340339    void print_diagnostics() const {
    341340        #ifdef HASH_TABLE_HPP_DEBUG
    342             cout << "Table Size:"                       << table_size << endl;
    343             cout << "Total Elements:"                   << elements << endl;
    344             cout << "Total Lookups (with resizes):"     << lookups << endl;
    345             cout << "Collisions(with resizes):"         << collisions << endl;
    346             cout << "Table Expansions:"                 << table_expansions << endl;
    347             cout << "Resize Chain Length:"              << resize_chain_lgth << endl;
    348             cout << endl;
     341            std::cout << "Table Size:"                  << table_size << std::endl;
     342            std::cout << "Total Elements:"                      << elements << std::endl;
     343            std::cout << "Total Lookups (with resizes):"        << lookups << std::endl;
     344            std::cout << "Collisions(with resizes):"            << collisions << std::endl;
     345            std::cout << "Table Expansions:"                    << table_expansions << std::endl;
     346            std::cout << "Resize Chain Length:"         << resize_chain_lgth << std::endl;
     347            std::cout << std::endl;
    349348        #else
    350             cout << "#define HASH_TABLE_HPP_DEBUG for diagnostics." << endl;
     349            std::cout << "#define HASH_TABLE_HPP_DEBUG for diagnostics." << std::endl;
    351350        #endif
    352351    }
  • trunk/symbol_table/src/symbol_table.hpp

    r2278 r2288  
    3131#include "hash_table.hpp"
    3232#include <cstdlib>
    33 #include <vector>
    34 using namespace std;
    3533
    3634#ifdef ID_SYMBOL_TABLE_TEMPLATE_HPP_DEBUG
    3735static void print_symbol_debug(gid_type gid, const uint8_t buffer [], const int32_t spos, const uint32_t fpos, const uint32_t lgth) {
    38         cout << "{Symbol:{";
    39         cout << "GID:" << gid;
    40         cout << ",Length:" << lgth;
    41         cout << ",Value:'" << string((char *)&(buffer[spos]), lgth) << "'";
    42         cout << ",Start:" << spos;
    43         cout << ",Follows:" << fpos;
    44         cout << "}}" << endl;
     36        std::cout << "{Symbol:{";
     37        std::cout << "GID:" << gid;
     38        std::cout << ",Length:" << lgth;
     39        std::cout << ",Value:'" << std::string((char *)&(buffer[spos]), lgth) << "'";
     40        std::cout << ",Start:" << spos;
     41        std::cout << ",Follows:" << fpos;
     42        std::cout << "}}" << std::endl;;
    4543}
    4644#endif
     
    8179public:
    8280    gid_type at[SIZE];
    83     //vector<BitBlock> gids_idx;   // gids index
    8481};
    8582
     
    315312                        if(spos < 0) { // boundary case
    316313                                        #ifdef ID_SYMBOL_TABLE_TEMPLATE_HPP_DEBUG
    317                                             cout << "Boundary Case: ";
     314                                            std::cout << "Boundary Case: ";
    318315                                        #endif
    319316
     
    376373                while(starts_rscanner.is_done()) { // boundary case
    377374                        #ifdef ID_SYMBOL_TABLE_TEMPLATE_HPP_DEBUG
    378                             cout << "Boundary Case: ";
     375                            std::cout << "Boundary Case: ";
    379376                        #endif
    380377
Note: See TracChangeset for help on using the changeset viewer.