From: Pierangelo Masarati Date: Sat, 17 Jan 2004 18:07:43 +0000 (+0000) Subject: cleanup X-Git-Tag: OPENLDAP_REL_ENG_2_1_MP~13 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=945f3fc9d046569d29cf4d047218b70c3e7ecadf;p=openldap cleanup --- diff --git a/servers/slapd/back-sql/init.c b/servers/slapd/back-sql/init.c index 686cc2c2d4..840ef0989a 100644 --- a/servers/slapd/back-sql/init.c +++ b/servers/slapd/back-sql/init.c @@ -58,11 +58,11 @@ sql_back_initialize( #if 0 /* needs updating */ #ifdef LDAP_CONTROL_NOOP LDAP_CONTROL_NOOP, -#endif +#endif /* LDAP_CONTROL_NOOP */ #endif #ifdef LDAP_CONTROL_VALUESRETURNFILTER LDAP_CONTROL_VALUESRETURNFILTER, -#endif +#endif /* LDAP_CONTROL_VALUESRETURNFILTER */ NULL }; diff --git a/servers/slapd/back-sql/schema-map.c b/servers/slapd/back-sql/schema-map.c index 106d73e4ff..3f75bb84ad 100644 --- a/servers/slapd/back-sql/schema-map.c +++ b/servers/slapd/back-sql/schema-map.c @@ -633,45 +633,6 @@ backsql_supad2at( backsql_oc_map_rec *objclass, AttributeDescription *supad, return 0; } - -#if 0 -/* - * Deprecated - */ -backsql_at_map_rec * -backsql_name2at( backsql_oc_map_rec* objclass, struct berval *attr ) -{ - backsql_at_map_rec tmp, *res; - const char *text = NULL; - -#ifdef BACKSQL_TRACE - Debug( LDAP_DEBUG_TRACE, "==>backsql_name2at(): " - "searching for attribute '%s' for objectclass '%s'\n", - attr, BACKSQL_OC_NAME( objclass ), 0 ); -#endif /* BACKSQL_TRACE */ - - if ( slap_bv2ad( attr, &tmp.bam_ad, &text ) != LDAP_SUCCESS ) { - return NULL; - } - - res = (backsql_at_map_rec *)avl_find( objclass->bom_attrs, &tmp, - backsql_cmp_attr ); - -#ifdef BACKSQL_TRACE - if ( res != NULL ) { - Debug( LDAP_DEBUG_TRACE, "<==backsql_name2at(): " - "found name='%s', sel_expr='%s'\n", - res->bam_name, res->bam_sel_expr.bv_val, 0 ); - } else { - Debug( LDAP_DEBUG_TRACE, "<==backsql_name2at(): " - "not found\n", 0, 0, 0 ); - } -#endif /* BACKSQL_TRACE */ - - return res; -} -#endif - static void backsql_free_attr( void *v_at ) { diff --git a/servers/slapd/back-sql/search.c b/servers/slapd/back-sql/search.c index 342b79becf..546b9dd321 100644 --- a/servers/slapd/back-sql/search.c +++ b/servers/slapd/back-sql/search.c @@ -639,7 +639,7 @@ equality_match:; } else { backsql_strfcat( &bsi->bsi_flt_where, "cblbl", - '(', + '(', /* ) */ &at->bam_sel_expr, (ber_len_t)sizeof( "='" ) - 1, "='", filter_value, @@ -670,7 +670,7 @@ equality_match:; if ( at->bam_sel_expr_u.bv_val ) { backsql_strfcat( &bsi->bsi_flt_where, "cbbc", - '(', + '(', /* ) */ &at->bam_sel_expr_u, &ordering, '\'' ); @@ -1428,16 +1428,15 @@ backsql_search( Operation *op, SlapReply *rs ) #if 0 /* noop is masked SLAP_CTRL_UPDATE */ if ( op->o_noop ) { sres = 0; - } else { + } else #endif + { rs->sr_attrs = op->oq_search.rs_attrs; rs->sr_entry = entry; sres = send_search_entry( op, rs ); rs->sr_entry = NULL; rs->sr_attrs = NULL; -#if 0 } -#endif switch ( sres ) { case 0: diff --git a/servers/slapd/back-sql/sql-wrap.c b/servers/slapd/back-sql/sql-wrap.c index 414aeafc54..07ec0e5b77 100644 --- a/servers/slapd/back-sql/sql-wrap.c +++ b/servers/slapd/back-sql/sql-wrap.c @@ -126,31 +126,6 @@ backsql_Prepare( SQLHDBC dbh, SQLHSTMT *sth, char *query, int timeout ) return SQLPrepare( *sth, query, SQL_NTS ); } -#if 0 -/* - * Turned into macros --- see sql-wrap.h - */ -RETCODE -backsql_BindParamStr( SQLHSTMT sth, int par_ind, char *str, int maxlen ) -{ - RETCODE rc; - - rc = SQLBindParameter( sth, (SQLUSMALLINT)par_ind, SQL_PARAM_INPUT, - SQL_C_CHAR, SQL_VARCHAR, - (SQLUINTEGER)maxlen, 0, (SQLPOINTER)str, - (SQLUINTEGER)maxlen, NULL ); - return rc; -} - -RETCODE -backsql_BindParamID( SQLHSTMT sth, int par_ind, unsigned long *id ) -{ - return SQLBindParameter( sth, (SQLUSMALLINT)par_ind, - SQL_PARAM_INPUT, SQL_C_ULONG, SQL_INTEGER, - 0, 0, (SQLPOINTER)id, 0, (SQLINTEGER*)NULL ); -} -#endif - RETCODE backsql_BindRowAsStrings( SQLHSTMT sth, BACKSQL_ROW_NTS *row ) { diff --git a/servers/slapd/back-sql/util.c b/servers/slapd/back-sql/util.c index cebd7a006f..02bd21d639 100644 --- a/servers/slapd/back-sql/util.c +++ b/servers/slapd/back-sql/util.c @@ -321,7 +321,7 @@ backsql_get_table_spec( char **p ) #if 0 backsql_strcat( &res, " AS ", s, NULL ); - /* oracle doesn't understand AS :( */ + /* oracle doesn't understand AS :( and other RDBMSes don't need it */ #endif /* table alias */