[ekiga] Removed all uses of str(n)casecmp
- From: Julien Puydt <jpuydt src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ekiga] Removed all uses of str(n)casecmp
- Date: Mon, 18 Oct 2010 19:58:40 +0000 (UTC)
commit 5c2406040b26676e5d28ccf3ab1bfc24016ee025
Author: Snark <jpuydt gnome org>
Date: Mon Oct 18 16:01:22 2010 +0200
Removed all uses of str(n)casecmp
I think g_ascii_str(n)casecmp is what we wanted anyway. It does simplify
the configure.ac a little.
configure.ac | 2 --
plugins/ldap/ldap-book.cpp | 9 ++++-----
2 files changed, 4 insertions(+), 7 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index b276a6d..3748c51 100644
--- a/configure.ac
+++ b/configure.ac
@@ -44,8 +44,6 @@ AC_PROG_CXX
AC_ISC_POSIX
AC_HEADER_STDC
-AC_CHECK_DECLS(strcasecmp)
-
dnl Enable compiler warnings
if test ".$ac_cv_c_compiler_gnu" = .yes; then
CFLAGS="$CFLAGS -Wall -Wextra -Winit-self -Wswitch-default -Wswitch-enum -Wstrict-aliasing=2 -Wfloat-equal -Wshadow"
diff --git a/plugins/ldap/ldap-book.cpp b/plugins/ldap/ldap-book.cpp
index cb27d17..41ff7ae 100644
--- a/plugins/ldap/ldap-book.cpp
+++ b/plugins/ldap/ldap-book.cpp
@@ -40,7 +40,6 @@
#include <string>
#include <sstream>
#include <sys/time.h>
-#include <string.h>
#include <glib.h>
@@ -90,11 +89,11 @@ OPENLDAP::Book::parse_result (LDAPMessage* message)
while (rc == LDAP_SUCCESS) {
rc = ldap_get_attribute_ber (ldap_context, message, ber, &bv, &bvals);
if (bv.bv_val == NULL) break;
- if (attributes[0] == NULL || !strcasecmp(bv.bv_val, attributes[0])) {
+ if (attributes[0] == NULL || !g_ascii_strcasecmp(bv.bv_val, attributes[0])) {
username = std::string (bvals[0].bv_val, bvals[0].bv_len);
} else {
for (i=1; attributes[i]; i++) {
- if (!strcasecmp(bv.bv_val,attributes[i]) && bvals && bvals[0].bv_val ) {
+ if (!g_ascii_strcasecmp(bv.bv_val,attributes[i]) && bvals && bvals[0].bv_val ) {
/* FIXME: this is annoying. Assume if a colon is present that
* the value is already in URI form, otherwise add a sip: prefix.
*/
@@ -385,9 +384,9 @@ OPENLDAP::BookInfoParse (struct BookInfo &info)
ldap_url_parse (info.uri.c_str(), &url_tmp);
if (url_tmp->lud_exts) {
for (int i=0; url_tmp->lud_exts[i]; i++) {
- if (!strcasecmp(url_tmp->lud_exts[i], "StartTLS")) {
+ if (!g_ascii_strcasecmp(url_tmp->lud_exts[i], "StartTLS")) {
info.starttls = true;
- } else if (!strncasecmp(url_tmp->lud_exts[i], "SASL", 4)) {
+ } else if (!g_ascii_strncasecmp(url_tmp->lud_exts[i], "SASL", 4)) {
info.sasl = true;
if (url_tmp->lud_exts[i][4] == '=')
info.saslMech = std::string(url_tmp->lud_exts[i]+5);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]