* [PATCH] Fix two unused variable warnings in gcc 4.6
@ 2011-03-28 1:32 Dan McGee
2011-03-28 13:05 ` Joshua Juran
0 siblings, 1 reply; 3+ messages in thread
From: Dan McGee @ 2011-03-28 1:32 UTC (permalink / raw)
To: git; +Cc: Dan McGee
Seen with -Wunused-but-set-variable.
Signed-off-by: Dan McGee <dpmcgee@gmail.com>
---
http-fetch.c | 3 +--
merge-recursive.c | 4 ----
2 files changed, 1 insertions(+), 6 deletions(-)
diff --git a/http-fetch.c b/http-fetch.c
index 923904f..3af4c71 100644
--- a/http-fetch.c
+++ b/http-fetch.c
@@ -8,7 +8,6 @@ static const char http_fetch_usage[] = "git http-fetch "
int main(int argc, const char **argv)
{
- const char *prefix;
struct walker *walker;
int commits_on_stdin = 0;
int commits;
@@ -60,7 +59,7 @@ int main(int argc, const char **argv)
if (argv[arg])
str_end_url_with_slash(argv[arg], &url);
- prefix = setup_git_directory();
+ setup_git_directory();
git_config(git_default_config, NULL);
diff --git a/merge-recursive.c b/merge-recursive.c
index 8e82a8b..af13150 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -356,7 +356,6 @@ static void make_room_for_directories_of_df_conflicts(struct merge_options *o,
*/
const char *last_file = NULL;
int last_len = 0;
- struct stage_data *last_e;
int i;
for (i = 0; i < entries->nr; i++) {
@@ -386,7 +385,6 @@ static void make_room_for_directories_of_df_conflicts(struct merge_options *o,
if (S_ISREG(e->stages[2].mode) || S_ISLNK(e->stages[2].mode)) {
last_file = path;
last_len = len;
- last_e = e;
} else {
last_file = NULL;
}
@@ -961,7 +959,6 @@ static int process_renames(struct merge_options *o,
}
for (i = 0, j = 0; i < a_renames->nr || j < b_renames->nr;) {
- char *src;
struct string_list *renames1, *renames2Dst;
struct rename *ren1 = NULL, *ren2 = NULL;
const char *branch1, *branch2;
@@ -996,7 +993,6 @@ static int process_renames(struct merge_options *o,
ren2 = ren1;
ren1 = tmp;
}
- src = ren1->pair->one->path;
ren1->dst_entry->processed = 1;
ren1->src_entry->processed = 1;
--
1.7.4.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Fix two unused variable warnings in gcc 4.6
2011-03-28 1:32 [PATCH] Fix two unused variable warnings in gcc 4.6 Dan McGee
@ 2011-03-28 13:05 ` Joshua Juran
2011-03-28 13:57 ` Dan McGee
0 siblings, 1 reply; 3+ messages in thread
From: Joshua Juran @ 2011-03-28 13:05 UTC (permalink / raw)
To: Dan McGee; +Cc: git
On Mar 27, 2011, at 6:32 PM, Dan McGee wrote:
> diff --git a/http-fetch.c b/http-fetch.c
> index 923904f..3af4c71 100644
> --- a/http-fetch.c
> +++ b/http-fetch.c
> @@ -8,7 +8,6 @@ static const char http_fetch_usage[] = "git http-
> fetch "
>
> int main(int argc, const char **argv)
> {
> - const char *prefix;
> struct walker *walker;
> int commits_on_stdin = 0;
> int commits;
> diff --git a/merge-recursive.c b/merge-recursive.c
> index 8e82a8b..af13150 100644
> --- a/merge-recursive.c
> +++ b/merge-recursive.c
> @@ -356,7 +356,6 @@ static void
> make_room_for_directories_of_df_conflicts(struct merge_options *o,
> */
> const char *last_file = NULL;
> int last_len = 0;
> - struct stage_data *last_e;
> int i;
>
> for (i = 0; i < entries->nr; i++) {
> @@ -961,7 +959,6 @@ static int process_renames(struct merge_options
> *o,
> }
>
> for (i = 0, j = 0; i < a_renames->nr || j < b_renames->nr;) {
> - char *src;
> struct string_list *renames1, *renames2Dst;
> struct rename *ren1 = NULL, *ren2 = NULL;
> const char *branch1, *branch2;
Looks like three unused variables, not two.
Josh
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Fix two unused variable warnings in gcc 4.6
2011-03-28 13:05 ` Joshua Juran
@ 2011-03-28 13:57 ` Dan McGee
0 siblings, 0 replies; 3+ messages in thread
From: Dan McGee @ 2011-03-28 13:57 UTC (permalink / raw)
To: Joshua Juran; +Cc: git
On Mon, Mar 28, 2011 at 8:05 AM, Joshua Juran <jjuran@gmail.com> wrote:
> On Mar 27, 2011, at 6:32 PM, Dan McGee wrote:
>
>> diff --git a/http-fetch.c b/http-fetch.c
>> index 923904f..3af4c71 100644
>> --- a/http-fetch.c
>> +++ b/http-fetch.c
>> @@ -8,7 +8,6 @@ static const char http_fetch_usage[] = "git http-fetch "
>>
>> int main(int argc, const char **argv)
>> {
>> - const char *prefix;
>> struct walker *walker;
>> int commits_on_stdin = 0;
>> int commits;
>> diff --git a/merge-recursive.c b/merge-recursive.c
>> index 8e82a8b..af13150 100644
>> --- a/merge-recursive.c
>> +++ b/merge-recursive.c
>> @@ -356,7 +356,6 @@ static void
>> make_room_for_directories_of_df_conflicts(struct merge_options *o,
>> */
>> const char *last_file = NULL;
>> int last_len = 0;
>> - struct stage_data *last_e;
>> int i;
>>
>> for (i = 0; i < entries->nr; i++) {
>> @@ -961,7 +959,6 @@ static int process_renames(struct merge_options *o,
>> }
>>
>> for (i = 0, j = 0; i < a_renames->nr || j < b_renames->nr;) {
>> - char *src;
>> struct string_list *renames1, *renames2Dst;
>> struct rename *ren1 = NULL, *ren2 = NULL;
>> const char *branch1, *branch2;
>
> Looks like three unused variables, not two.
You are correct, my lack of caffeine can be blamed for the misleading
message. I didn't think it was important enough to resubmit for that
though.
-Dan
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-03-28 13:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-28 1:32 [PATCH] Fix two unused variable warnings in gcc 4.6 Dan McGee
2011-03-28 13:05 ` Joshua Juran
2011-03-28 13:57 ` Dan McGee
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).