[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[tyndur-devel] [PATCH] libc: fix variable x set but not used



! posix/socket.c: verschluckt jetzt keine fehler mehr
* posix/getopt_long.c: nur von DEBUG-code genutzte variablen
  mit __attribute__((unused)) markiert.
* posix/regex/engine.h: nur von DEBUG-code genutzte variablen
  mit __attribute__((unused)) markiert.
- mmc_contexct.c(i386): entferne unbenutzten code

Signed-off-by: Andreas Freimuth <m.nemo@xxxxxxx>
---
 src/kernel2/src/arch/i386/mm/mm_context.c |    7 +------
 src/modules/lib/posix/getopt_long.c       |    2 +-
 src/modules/lib/posix/regex/engine.h      |    2 +-
 src/modules/lib/posix/socket.c            |    2 +-
 4 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/src/kernel2/src/arch/i386/mm/mm_context.c b/src/kernel2/src/arch/i386/mm/mm_context.c
index affb8e6..bfeb84e 100644
--- a/src/kernel2/src/arch/i386/mm/mm_context.c
+++ b/src/kernel2/src/arch/i386/mm/mm_context.c
@@ -472,7 +472,6 @@ paddr_t mmc_resolve(mmc_context_t* context, vaddr_t vaddr)
 {
     page_directory_t page_directory = context->page_directory_virt;
     page_table_t page_table;
-    paddr_t phys_page_table;
     paddr_t result;
     
     uint32_t vpage = (uint32_t) vaddr / PAGE_SIZE;
@@ -491,11 +490,7 @@ paddr_t mmc_resolve(mmc_context_t* context, vaddr_t vaddr)
           | ((uint32_t) vaddr & 0x3FFFFF));
         
     } 
-    else 
-    {
-        phys_page_table = (page_directory[vpage / PAGE_TABLE_LENGTH] & ~0xFFF);
-    }
-        
+
     // Die Page-Table-Adresse ist eine physische Adresse. Am sichersten ist es,
     // die Adresse einfach noch einmal zu mappen.
     page_table = get_pagetable(context, vpage / PAGE_TABLE_LENGTH);
diff --git a/src/modules/lib/posix/getopt_long.c b/src/modules/lib/posix/getopt_long.c
index f123181..2639e95 100644
--- a/src/modules/lib/posix/getopt_long.c
+++ b/src/modules/lib/posix/getopt_long.c
@@ -203,7 +203,7 @@ parse_long_options(char * const *nargv, const char *options,
 {
 	char *current_argv, *has_equal;
 #ifdef GNU_COMPATIBLE
-	char *current_dash;
+	char *current_dash __attribute__((unused));
 #endif
 	size_t current_argv_len;
 	int i, match, exact_match, second_partial_match;
diff --git a/src/modules/lib/posix/regex/engine.h b/src/modules/lib/posix/regex/engine.h
index 36a6440..385d4cd 100644
--- a/src/modules/lib/posix/regex/engine.h
+++ b/src/modules/lib/posix/regex/engine.h
@@ -382,7 +382,7 @@ dissect(struct match *m,
 	const char *ssp;	/* start of string matched by subsubRE */
 	const char *sep;	/* end of string matched by subsubRE */
 	const char *oldssp;	/* previous ssp */
-	const char *dp;
+	const char *dp __attribute__((unused));
 
 	AT("diss", start, stop, startst, stopst);
 	sp = start;
diff --git a/src/modules/lib/posix/socket.c b/src/modules/lib/posix/socket.c
index 462c41c..1179a67 100644
--- a/src/modules/lib/posix/socket.c
+++ b/src/modules/lib/posix/socket.c
@@ -169,7 +169,7 @@ out_path:
 out_ip_string:
     free(ip_string);
 
-    return 0;
+    return ret;
 }
 
 /**
-- 
1.7.4.2