From 4d6483e392466a6c28b50ebf98860b16dc09e48f Mon Sep 17 00:00:00 2001 From: Marco van Wieringen Date: Thu, 1 Apr 2010 20:55:55 +0200 Subject: [PATCH] Make some static functions inline as they only are called once and are there mostly to describe a functional method. --- bacula/src/cats/myingres.sc | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/bacula/src/cats/myingres.sc b/bacula/src/cats/myingres.sc index 13eeee684e..1289f13eed 100644 --- a/bacula/src/cats/myingres.sc +++ b/bacula/src/cats/myingres.sc @@ -54,7 +54,7 @@ short INGgetCols(const char *query) return number; } -static IISQLDA *INGgetDescriptor(short numCols, const char *query) +static inline IISQLDA *INGgetDescriptor(short numCols, const char *query) { EXEC SQL BEGIN DECLARE SECTION; char *stmt; @@ -131,7 +131,7 @@ static void INGfreeDescriptor(IISQLDA *sqlda) sqlda = NULL; } -static int INGgetTypeSize(IISQLVAR *ingvar) +static inline int INGgetTypeSize(IISQLVAR *ingvar) { int inglength = 0; @@ -153,7 +153,7 @@ static int INGgetTypeSize(IISQLVAR *ingvar) return inglength; } -static INGresult *INGgetINGresult(IISQLDA *sqlda) +static inline INGresult *INGgetINGresult(IISQLDA *sqlda) { if (!sqlda) { return NULL; @@ -222,7 +222,7 @@ static void INGfreeINGresult(INGresult *ing_res) ing_res = NULL; } -static ING_ROW *INGgetRowSpace(INGresult *ing_res) +static inline ING_ROW *INGgetRowSpace(INGresult *ing_res) { int i; unsigned short len; /* used for VARCHAR type length */ @@ -301,7 +301,7 @@ static ING_ROW *INGgetRowSpace(INGresult *ing_res) return row; } -static void INGfreeRowSpace(ING_ROW *row, IISQLDA *sqlda) +static inline void INGfreeRowSpace(ING_ROW *row, IISQLDA *sqlda) { int i; @@ -321,7 +321,7 @@ static void INGfreeRowSpace(ING_ROW *row, IISQLDA *sqlda) free(row); } -static int INGfetchAll(const char *query, INGresult *ing_res) +static inline int INGfetchAll(const char *query, INGresult *ing_res) { int linecount = 0; ING_ROW *row; @@ -369,10 +369,13 @@ static int INGfetchAll(const char *query, INGresult *ing_res) return linecount; } -static ING_STATUS INGresultStatus(INGresult *res) +static inline ING_STATUS INGresultStatus(INGresult *res) { - if (res == NULL) {return ING_NO_RESULT;} - return res->status; + if (res == NULL) { + return ING_NO_RESULT; + } else { + return res->status; + } } static void INGrowSeek(INGresult *res, int row_number) -- 2.39.5