[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha7-1097-g6248038

Günther Deschner gd at samba.org
Sun Apr 19 23:07:02 GMT 2009


The branch, master has been updated
       via  62480385c1e551448e40b01fff8e9dee318c29c1 (commit)
      from  d9aaf3759ac7fd6ce07a347a0138bdfb27a6f929 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 62480385c1e551448e40b01fff8e9dee318c29c1
Author: Günther Deschner <gd at samba.org>
Date:   Sat Apr 18 00:58:12 2009 +0200

    s3-printing: use ARRAY_SIZE() macro in forms functions.
    
    Guenther

-----------------------------------------------------------------------

Summary of changes:
 source3/printing/nt_printing.c |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c
index b96d64b..d6fead1 100644
--- a/source3/printing/nt_printing.c
+++ b/source3/printing/nt_printing.c
@@ -745,7 +745,7 @@ int get_builtin_ntforms(nt_forms_struct **list)
 	if (!*list) {
 		return 0;
 	}
-	return sizeof(default_forms) / sizeof(default_forms[0]);
+	return ARRAY_SIZE(default_forms);
 }
 
 /****************************************************************************
@@ -754,18 +754,17 @@ int get_builtin_ntforms(nt_forms_struct **list)
 
 bool get_a_builtin_ntform_by_string(const char *form_name, nt_forms_struct *form)
 {
-	int i,count;
+	int i;
 	DEBUGADD(6,("Looking for builtin form %s \n", form_name));
-	count = sizeof(default_forms) / sizeof(default_forms[0]);
-	for (i=0;i<count;i++) {
+	for (i=0; i<ARRAY_SIZE(default_forms); i++) {
 		if (strequal(form_name,default_forms[i].name)) {
 			DEBUGADD(6,("Found builtin form %s \n", form_name));
 			memcpy(form,&default_forms[i],sizeof(*form));
-			break;
+			return true;
 		}
 	}
 
-	return (i !=count);
+	return false;
 }
 
 /****************************************************************************


-- 
Samba Shared Repository


More information about the samba-cvs mailing list