diff --git a/example/example.cpp b/example/example.cpp index 7cf0817..4cceb60 100644 --- a/example/example.cpp +++ b/example/example.cpp @@ -25,7 +25,7 @@ int main(int argc, char* argv[]) { printf("Parsed successfully!\n"); printf("Number of statements: %lu\n", result.size()); - for (uint i = 0; i < result.size(); ++i) { + for (auto i = 0u; i < result.size(); ++i) { // Print a statement summary. hsql::printStatementInfo(result.getStatement(i)); } diff --git a/src/util/sqlhelper.cpp b/src/util/sqlhelper.cpp index b6ad14b..459c0ba 100644 --- a/src/util/sqlhelper.cpp +++ b/src/util/sqlhelper.cpp @@ -1,6 +1,6 @@ #include "sqlhelper.h" -#include +#include #include namespace hsql { @@ -11,22 +11,22 @@ namespace hsql { return std::string(numIndent, '\t'); } void inprint(int64_t val, uintmax_t numIndent) { - printf("%s%ld \n", indent(numIndent).c_str(), val); + std::cout << indent(numIndent).c_str() << val << " " << std::endl; } void inprint(float val, uintmax_t numIndent) { - printf("%s%f\n", indent(numIndent).c_str(), val); + std::cout << indent(numIndent).c_str() << val << std::endl; } void inprint(const char* val, uintmax_t numIndent) { - printf("%s%s\n", indent(numIndent).c_str(), val); + std::cout << indent(numIndent).c_str() << val << std::endl; } void inprint(const char* val, const char* val2, uintmax_t numIndent) { - printf("%s%s->%s\n", indent(numIndent).c_str(), val, val2); + std::cout << indent(numIndent).c_str() << val << "->" << val2 << std::endl; } void inprintC(char val, uintmax_t numIndent) { - printf("%s%c\n", indent(numIndent).c_str(), val); + std::cout << indent(numIndent).c_str() << val << std::endl; } void inprintU(uint64_t val, uintmax_t numIndent) { - printf("%s%lu\n", indent(numIndent).c_str(), val); + std::cout << indent(numIndent).c_str() << val << std::endl; } void printTableRefInfo(TableRef* table, uintmax_t numIndent) { @@ -109,7 +109,7 @@ namespace hsql { printOperatorExpression(expr, numIndent); break; default: - fprintf(stderr, "Unrecognized expression type %d\n", expr->type); + std::cerr << "Unrecognized expression type " << expr->type << std::endl; return; } if (expr->alias != nullptr) { @@ -205,4 +205,4 @@ namespace hsql { } } -} // namespace hsql \ No newline at end of file +} // namespace hsql