@@ -69,7 +69,7 @@ extern GLOBAL_VALUES globals;
6969 *How to map ODBC scalar functions {fn func(args)} to Postgres.
7070 *This is just a simple substitution. List augmented from:
7171 *http://www.merant.com/datadirect/download/docs/odbc16/Odbcref/rappc.htm
72- * - thomas 2000-04-03
72+ *- thomas 2000-04-03
7373 */
7474char * mapFuncs [][2 ]= {
7575/*{ "ASCII", "ascii" }, */
@@ -199,9 +199,7 @@ copy_and_convert_field(StatementClass *stmt, Int4 field_type, void *value, Int2
199199 */
200200
201201if (bind_size > 0 )
202- {
203202pcbValueOffset = rgbValueOffset = (bind_size * bind_row );
204- }
205203else
206204{
207205pcbValueOffset = bind_row * sizeof (SDWORD );
@@ -221,9 +219,10 @@ copy_and_convert_field(StatementClass *stmt, Int4 field_type, void *value, Int2
221219
222220if (!value )
223221{
222+
224223/*
225- * handle a null just by returning SQL_NULL_DATA in pcbValue,
226- *and doing nothing to the buffer.
224+ * handle a null just by returning SQL_NULL_DATA in pcbValue, and
225+ * doing nothing to the buffer.
227226 */
228227if (pcbValue )
229228* (SDWORD * ) ((char * )pcbValue + pcbValueOffset )= SQL_NULL_DATA ;
@@ -242,18 +241,18 @@ copy_and_convert_field(StatementClass *stmt, Int4 field_type, void *value, Int2
242241}
243242
244243/*
245- *First convert any specific postgres types into more
246- *useable data.
244+ * First convert any specific postgres types into more useable data.
247245 *
248- * NOTE: Conversions from PG char/varchar of a date/time/timestamp
249- *value to SQL_C_DATE,SQL_C_TIME, SQL_C_TIMESTAMP not supported
246+ * NOTE: Conversions from PG char/varchar of a date/time/timestamp value
247+ * to SQL_C_DATE,SQL_C_TIME, SQL_C_TIMESTAMP not supported
250248 */
251249switch (field_type )
252250{
253- /*
254- * $$$ need to add parsing for date/time/timestamp strings in
255- * PG_TYPE_CHAR,VARCHAR $$$
256- */
251+
252+ /*
253+ * $$$ need to add parsing for date/time/timestamp strings in
254+ * PG_TYPE_CHAR,VARCHAR $$$
255+ */
257256case PG_TYPE_DATE :
258257sscanf (value ,"%4d-%2d-%2d" ,& st .y ,& st .m ,& st .d );
259258break ;
@@ -269,9 +268,10 @@ copy_and_convert_field(StatementClass *stmt, Int4 field_type, void *value, Int2
269268sscanf (value ,"%4d-%2d-%2d %2d:%2d:%2d" ,& st .y ,& st .m ,& st .d ,& st .hh ,& st .mm ,& st .ss );
270269else
271270{
271+
272272/*
273- * The timestamp is invalid so set
274- *something conspicuous, like the epoch
273+ * The timestamp is invalid so set something conspicuous,
274+ * like the epoch
275275 */
276276t = 0 ;
277277tim = localtime (& t );
@@ -295,7 +295,7 @@ copy_and_convert_field(StatementClass *stmt, Int4 field_type, void *value, Int2
295295}
296296break ;
297297
298- /* This is for internal use by SQLStatistics() */
298+ /* This is for internal use by SQLStatistics() */
299299case PG_TYPE_INT2VECTOR :
300300{
301301int nval ,
@@ -379,6 +379,7 @@ copy_and_convert_field(StatementClass *stmt, Int4 field_type, void *value, Int2
379379if (fCType == SQL_C_CHAR )
380380{
381381/* Special character formatting as required */
382+
382383/*
383384 * These really should return error if cbValueMax is not big
384385 * enough.
@@ -483,6 +484,7 @@ copy_and_convert_field(StatementClass *stmt, Int4 field_type, void *value, Int2
483484}
484485else
485486{
487+
486488/*
487489 * for SQL_C_CHAR, it's probably ok to leave currency symbols in.
488490 * But to convert to numeric types, it is necessary to get rid of
@@ -780,8 +782,10 @@ copy_statement_with_parameters(StatementClass *stmt)
780782
781783#ifdef MULTIBYTE
782784char * end = multibyte_strchr (begin ,'}' );
785+
783786#else
784787char * end = strchr (begin ,'}' );
788+
785789#endif
786790
787791if (!end )
@@ -806,6 +810,7 @@ copy_statement_with_parameters(StatementClass *stmt)
806810* end = '}' ;
807811continue ;
808812}
813+
809814/*
810815 * Can you have parameter markers inside of quotes? I dont think
811816 * so. All the queries I've seen expect the driver to put quotes
@@ -1101,9 +1106,7 @@ copy_statement_with_parameters(StatementClass *stmt)
11011106case SQL_LONGVARBINARY :
11021107
11031108if (stmt -> parameters [param_number ].data_at_exec )
1104- {
11051109lobj_oid = stmt -> parameters [param_number ].lobj_oid ;
1106- }
11071110else
11081111{
11091112/* begin transaction if needed */
@@ -1308,14 +1311,16 @@ convert_escape(char *value)
13081311
13091312if ((strcmp (key ,"d" )== 0 )||
13101313(strcmp (key ,"t" )== 0 )||
1311- (strcmp (key ,"oj" )== 0 )|| /* {oj syntax support for 7.1 servers */
1314+ (strcmp (key ,"oj" )== 0 )|| /* {oj syntax support for 7.1
1315+ * servers */
13121316(strcmp (key ,"ts" )== 0 ))
13131317{
13141318/* Literal; return the escape part as-is */
13151319strncpy (escape ,value ,sizeof (escape )- 1 );
13161320}
13171321else if (strcmp (key ,"fn" )== 0 )
13181322{
1323+
13191324/*
13201325 * Function invocation Separate off the func name, skipping
13211326 * trailing whitespace.
@@ -1722,7 +1727,7 @@ convert_lo(StatementClass *stmt, void *value, Int2 fCType, PTR rgbValue,
17221727BindInfoClass * bindInfo = NULL ;
17231728
17241729
1725- /* If using SQLGetData, then current_col will be set */
1730+ /* If using SQLGetData, then current_col will be set */
17261731if (stmt -> current_col >=0 )
17271732{
17281733bindInfo = & stmt -> bindings [stmt -> current_col ];