From e48a50a73f0970eff89729632caa7ada1173c833 Mon Sep 17 00:00:00 2001 From: Oleksandr Zinenko Date: Tue, 14 Apr 2015 18:50:42 +0200 Subject: [PATCH] Codestyle --- source/generic.c | 14 +++++--------- source/strings.c | 34 ++++++++++++++++------------------ 2 files changed, 21 insertions(+), 27 deletions(-) diff --git a/source/generic.c b/source/generic.c index 90aab4c..312c9cf 100644 --- a/source/generic.c +++ b/source/generic.c @@ -538,19 +538,17 @@ int osl_generic_number(osl_generic_p generic) { * \return A pointer to the clone of the input generic structure. */ osl_generic_p osl_generic_clone(osl_generic_p generic) { - return osl_generic_nclone(generic,-1); + return osl_generic_nclone(generic, -1); } /** - * @brief This function builds and returns a "hard copy" (not a pointer copy) + * \brief This function builds and returns a "hard copy" (not a pointer copy) * of the n first elements of an osl_generic_t list. * * \param generic The pointer to the generic structure we want to clone. * \param n The number of nodes we want to copy (n<0 for infinity). * \return The clone of the n first nodes of the generic list. - * - * @return */ osl_generic_p osl_generic_nclone(osl_generic_p generic, int n) { @@ -558,12 +556,11 @@ osl_generic_p osl_generic_nclone(osl_generic_p generic, int n) osl_interface_p interface; void * x; - if(n<0) - { + if (n < 0) { n = osl_generic_count(generic); } - while ((generic != NULL) && (n>0)) { + while ((generic != NULL) && (n > 0)) { if (generic->interface != NULL) { x = generic->interface->clone(generic->data); interface = osl_interface_clone(generic->interface); @@ -571,8 +568,7 @@ osl_generic_p osl_generic_nclone(osl_generic_p generic, int n) new->interface = interface; new->data = x; osl_generic_add(&clone, new); - } - else { + } else { OSL_warning("unregistered interface, cloning ignored"); } generic = generic->next; diff --git a/source/strings.c b/source/strings.c index d3710ea..ef1ad80 100644 --- a/source/strings.c +++ b/source/strings.c @@ -495,28 +495,26 @@ osl_strings_p osl_strings_generate(char * prefix, int nb_strings) { return generated; } - /** - * @brief Concatenate two osl_strings into one. The parameter are cloned and not modified. + * \brief Concatenate two osl_strings into one. The parameter are cloned and not modified. * - * @param dest[out] A pointer to the destination osl_strings. - * @param str1[in] The first osl_strings. - * @param str2[in] The second osl_strings. + * \param dest[out] A pointer to the destination osl_strings. + * \param str1[in] The first osl_strings. + * \param str2[in] The second osl_strings. */ void osl_strings_add_strings( osl_strings_p * dest, osl_strings_p str1, - osl_strings_p str2) -{ - struct osl_strings * res = NULL; - unsigned int i = 0; - - res = osl_strings_clone(str1); - while(str2->string[i] != NULL) - { - osl_strings_add(res, str2->string[i]); - i++; - } - - *dest = res; + osl_strings_p str2) { + struct osl_strings * res = NULL; + unsigned int i = 0; + + res = osl_strings_clone(str1); + while (str2->string[i] != NULL) { + osl_strings_add(res, str2->string[i]); + i++; + } + + *dest = res; } + -- 2.11.4.GIT