From patchwork Tue Sep 27 19:47:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Adriano Pallavicino X-Patchwork-Id: 753 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.140.66 with SMTP id o63csp39988vsd; Tue, 27 Sep 2016 12:47:56 -0700 (PDT) X-Received: by 10.194.133.72 with SMTP id pa8mr9792136wjb.0.1475005676069; Tue, 27 Sep 2016 12:47:56 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id l199si15458878wmg.142.2016.09.27.12.47.43; Tue, 27 Sep 2016 12:47:56 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1E6BF689E85; Tue, 27 Sep 2016 22:47:29 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm0-f44.google.com (mail-wm0-f44.google.com [74.125.82.44]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 28529689C28 for ; Tue, 27 Sep 2016 22:47:22 +0300 (EEST) Received: by mail-wm0-f44.google.com with SMTP id b130so32088660wmc.0 for ; Tue, 27 Sep 2016 12:47:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to; bh=CL7eaK+/bZLib8Ks/knKPrc4iQ/IBKilDICqI9AUE08=; b=MLaJfeSgUWn6v3JnGCCxkHrN2k0eF898CXVppBZ0SKUJDTvkQ4I5L/1tJYqK2uCzvD FVebQgoUIpkfze+6OkfBANCGwjgN8VKJ5JTkjQ6KV/tFuj8k4a3xunTtmhetULUmp5ld eWYCuS+tTaMVRWLOPgQll7Re43wx7SIbsOmxRB3HT2hA0ZwpMXY0mdKkUhm22BiROK9a 3jrH4dNj0gc67TNclD9orRVws8wSbIXiB5nqWIjpJHRzeOqFNXMEFMe2TxuSStmEy2GF 5QaOwk6Mrai5cVDDjz1TC0HtJZNIuwScAJcicj4LXKO31+nc4MXb6DnmPfLV06BeAQY6 hKhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to; bh=CL7eaK+/bZLib8Ks/knKPrc4iQ/IBKilDICqI9AUE08=; b=IU16HJKx+rV0Wa3GC5nTvLEAuVZ7IR9EXQDD659qPGYNjAqUgxPVSh5KI5zhDsLnWc lztHmFqs+E4LGY0lnJ5HhiXpRVSPYnNY9PrAxg1qOAo8nUOIMCqxh9mn541Gv8ZoG4oa Dn6c3avf+dIDoxEcB7DvgvvZqAtraZPqecho0oFch+7zT+TAtgMTWRSdPxQXoI2OHPQb Gt+WZo3pQHPExu1DL+v3wfCoKD7EIJ8lVtZkr233sjigU/5O1y1jbWGdT9wvUu0NHRuc ew9A3rOLWMWaP7OCZSWrHXABiIFj+CTXDSf6QhT1rCKpT23X2U3JU+1K1pQmXTDq0bOO iPaA== X-Gm-Message-State: AA6/9RnQUGvBx/voYA1hWGXXyCvPMGitGfqDVPS3l7Nq/0kWiMkpce2+SUUarXcopCwFSwzeGd4c80uAi2xdhw== X-Received: by 10.28.126.6 with SMTP id z6mr4681061wmc.125.1475005653369; Tue, 27 Sep 2016 12:47:33 -0700 (PDT) MIME-Version: 1.0 Received: by 10.28.69.84 with HTTP; Tue, 27 Sep 2016 12:47:32 -0700 (PDT) In-Reply-To: <6503e320-54ba-3a09-be35-a58c87af2d14@itanimul.li> References: <6503e320-54ba-3a09-be35-a58c87af2d14@itanimul.li> From: Adriano Pallavicino Date: Tue, 27 Sep 2016 21:47:32 +0200 X-Google-Sender-Auth: SyI8tTHZ6qXz_NgF22Iz1dWQ82Q Message-ID: To: FFmpeg development discussions and patches X-Content-Filtered-By: Mailman/MimeDel 2.1.20 Subject: Re: [FFmpeg-devel] [PATCH] libavcodec/qdm2.c: fix warning due to misleading indentation X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Sure Adriano 2016-09-27 21:19 GMT+02:00 Josh de Kock : > On 27/09/2016 19:46, Adriano Pallavicino wrote: > >> --- >> libavcodec/qdm2.c | 117 >> +++++++++++++++++++++++++++--------------------------- >> 1 file changed, 59 insertions(+), 58 deletions(-) >> >> diff --git a/libavcodec/qdm2.c b/libavcodec/qdm2.c >> index dd8b257..e3cc902 100644 >> --- a/libavcodec/qdm2.c >> +++ b/libavcodec/qdm2.c >> @@ -537,7 +537,7 @@ static void fill_coding_method_array(sb_int8_array >> tone_level_idx, >> /* This case is untested, no samples available */ >> avpriv_request_sample(NULL, "!superblocktype_2_3"); >> return; >> - for (ch = 0; ch < nb_channels; ch++) >> + for (ch = 0; ch < nb_channels; ch++) { >> for (sb = 0; sb < 30; sb++) { >> for (j = 1; j < 63; j++) { // The loop only iterates to >> 63 so the code doesn't overflow the buffer >> add1 = tone_level_idx[ch][sb][j] - 10; >> @@ -566,67 +566,68 @@ static void fill_coding_method_array(sb_int8_array >> tone_level_idx, >> } >> tone_level_idx_temp[ch][sb][0] = >> tone_level_idx_temp[ch][sb][1]; >> } >> - acc = 0; >> - for (ch = 0; ch < nb_channels; ch++) >> - for (sb = 0; sb < 30; sb++) >> - for (j = 0; j < 64; j++) >> - acc += tone_level_idx_temp[ch][sb][j]; >> - >> - multres = 0x66666667LL * (acc * 10); >> - esp_40 = (multres >> 32) / 8 + ((multres & 0xffffffff) >> >> 31); >> - for (ch = 0; ch < nb_channels; ch++) >> - for (sb = 0; sb < 30; sb++) >> - for (j = 0; j < 64; j++) { >> - comp = tone_level_idx_temp[ch][sb][j]* esp_40 * >> 10; >> - if (comp < 0) >> - comp += 0xff; >> - comp /= 256; // signed shift >> - switch(sb) { >> - case 0: >> - if (comp < 30) >> - comp = 30; >> - comp += 15; >> - break; >> - case 1: >> - if (comp < 24) >> - comp = 24; >> - comp += 10; >> - break; >> - case 2: >> - case 3: >> - case 4: >> - if (comp < 16) >> - comp = 16; >> - } >> - if (comp <= 5) >> - tmp = 0; >> - else if (comp <= 10) >> - tmp = 10; >> - else if (comp <= 16) >> - tmp = 16; >> - else if (comp <= 24) >> - tmp = -1; >> - else >> - tmp = 0; >> - coding_method[ch][sb][j] = ((tmp & 0xfffa) + 30 >> )& >> 0xff; >> + } >> + acc = 0; >> + for (ch = 0; ch < nb_channels; ch++) >> + for (sb = 0; sb < 30; sb++) >> + for (j = 0; j < 64; j++) >> + acc += tone_level_idx_temp[ch][sb][j]; >> + >> + multres = 0x66666667LL * (acc * 10); >> + esp_40 = (multres >> 32) / 8 + ((multres & 0xffffffff) >> 31); >> + for (ch = 0; ch < nb_channels; ch++) >> + for (sb = 0; sb < 30; sb++) >> + for (j = 0; j < 64; j++) { >> + comp = tone_level_idx_temp[ch][sb][j]* esp_40 * 10; >> + if (comp < 0) >> + comp += 0xff; >> + comp /= 256; // signed shift >> + switch(sb) { >> + case 0: >> + if (comp < 30) >> + comp = 30; >> + comp += 15; >> + break; >> + case 1: >> + if (comp < 24) >> + comp = 24; >> + comp += 10; >> + break; >> + case 2: >> + case 3: >> + case 4: >> + if (comp < 16) >> + comp = 16; >> } >> + if (comp <= 5) >> + tmp = 0; >> + else if (comp <= 10) >> + tmp = 10; >> + else if (comp <= 16) >> + tmp = 16; >> + else if (comp <= 24) >> + tmp = -1; >> + else >> + tmp = 0; >> + coding_method[ch][sb][j] = ((tmp & 0xfffa) + 30 )& >> 0xff; >> + } >> + for (sb = 0; sb < 30; sb++) >> + fix_coding_method_array(sb, nb_channels, coding_method); >> + for (ch = 0; ch < nb_channels; ch++) >> for (sb = 0; sb < 30; sb++) >> - fix_coding_method_array(sb, nb_channels, coding_method); >> - for (ch = 0; ch < nb_channels; ch++) >> - for (sb = 0; sb < 30; sb++) >> - for (j = 0; j < 64; j++) >> - if (sb >= 10) { >> - if (coding_method[ch][sb][j] < 10) >> - coding_method[ch][sb][j] = 10; >> + for (j = 0; j < 64; j++) >> + if (sb >= 10) { >> + if (coding_method[ch][sb][j] < 10) >> + coding_method[ch][sb][j] = 10; >> + } else { >> + if (sb >= 2) { >> + if (coding_method[ch][sb][j] < 16) >> + coding_method[ch][sb][j] = 16; >> } else { >> - if (sb >= 2) { >> - if (coding_method[ch][sb][j] < 16) >> - coding_method[ch][sb][j] = 16; >> - } else { >> - if (coding_method[ch][sb][j] < 30) >> - coding_method[ch][sb][j] = 30; >> - } >> + if (coding_method[ch][sb][j] < 30) >> + coding_method[ch][sb][j] = 30; >> } >> + } >> } else { // superblocktype_2_3 != 0 >> for (ch = 0; ch < nb_channels; ch++) >> for (sb = 0; sb < 30; sb++) >> >> > Could you send the patch as an attachment it is corrupted. > > -- > Josh > _______________________________________________ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel > From c80cdc96e59c695dfc977371791f9de282f71629 Mon Sep 17 00:00:00 2001 From: Adriano Pallavicino Date: Tue, 27 Sep 2016 20:22:20 +0200 Subject: [PATCH] Fix warning error due to missing {} around for loop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit libavcodec/qdm2.c:540:9: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] for (ch = 0; ch < nb_channels; ch++) --- libavcodec/qdm2.c | 117 +++++++++++++++++++++++++++--------------------------- 1 file changed, 59 insertions(+), 58 deletions(-) diff --git a/libavcodec/qdm2.c b/libavcodec/qdm2.c index dd8b257..e3cc902 100644 --- a/libavcodec/qdm2.c +++ b/libavcodec/qdm2.c @@ -537,7 +537,7 @@ static void fill_coding_method_array(sb_int8_array tone_level_idx, /* This case is untested, no samples available */ avpriv_request_sample(NULL, "!superblocktype_2_3"); return; - for (ch = 0; ch < nb_channels; ch++) + for (ch = 0; ch < nb_channels; ch++) { for (sb = 0; sb < 30; sb++) { for (j = 1; j < 63; j++) { // The loop only iterates to 63 so the code doesn't overflow the buffer add1 = tone_level_idx[ch][sb][j] - 10; @@ -566,67 +566,68 @@ static void fill_coding_method_array(sb_int8_array tone_level_idx, } tone_level_idx_temp[ch][sb][0] = tone_level_idx_temp[ch][sb][1]; } - acc = 0; - for (ch = 0; ch < nb_channels; ch++) - for (sb = 0; sb < 30; sb++) - for (j = 0; j < 64; j++) - acc += tone_level_idx_temp[ch][sb][j]; - - multres = 0x66666667LL * (acc * 10); - esp_40 = (multres >> 32) / 8 + ((multres & 0xffffffff) >> 31); - for (ch = 0; ch < nb_channels; ch++) - for (sb = 0; sb < 30; sb++) - for (j = 0; j < 64; j++) { - comp = tone_level_idx_temp[ch][sb][j]* esp_40 * 10; - if (comp < 0) - comp += 0xff; - comp /= 256; // signed shift - switch(sb) { - case 0: - if (comp < 30) - comp = 30; - comp += 15; - break; - case 1: - if (comp < 24) - comp = 24; - comp += 10; - break; - case 2: - case 3: - case 4: - if (comp < 16) - comp = 16; - } - if (comp <= 5) - tmp = 0; - else if (comp <= 10) - tmp = 10; - else if (comp <= 16) - tmp = 16; - else if (comp <= 24) - tmp = -1; - else - tmp = 0; - coding_method[ch][sb][j] = ((tmp & 0xfffa) + 30 )& 0xff; + } + acc = 0; + for (ch = 0; ch < nb_channels; ch++) + for (sb = 0; sb < 30; sb++) + for (j = 0; j < 64; j++) + acc += tone_level_idx_temp[ch][sb][j]; + + multres = 0x66666667LL * (acc * 10); + esp_40 = (multres >> 32) / 8 + ((multres & 0xffffffff) >> 31); + for (ch = 0; ch < nb_channels; ch++) + for (sb = 0; sb < 30; sb++) + for (j = 0; j < 64; j++) { + comp = tone_level_idx_temp[ch][sb][j]* esp_40 * 10; + if (comp < 0) + comp += 0xff; + comp /= 256; // signed shift + switch(sb) { + case 0: + if (comp < 30) + comp = 30; + comp += 15; + break; + case 1: + if (comp < 24) + comp = 24; + comp += 10; + break; + case 2: + case 3: + case 4: + if (comp < 16) + comp = 16; } + if (comp <= 5) + tmp = 0; + else if (comp <= 10) + tmp = 10; + else if (comp <= 16) + tmp = 16; + else if (comp <= 24) + tmp = -1; + else + tmp = 0; + coding_method[ch][sb][j] = ((tmp & 0xfffa) + 30 )& 0xff; + } + for (sb = 0; sb < 30; sb++) + fix_coding_method_array(sb, nb_channels, coding_method); + for (ch = 0; ch < nb_channels; ch++) for (sb = 0; sb < 30; sb++) - fix_coding_method_array(sb, nb_channels, coding_method); - for (ch = 0; ch < nb_channels; ch++) - for (sb = 0; sb < 30; sb++) - for (j = 0; j < 64; j++) - if (sb >= 10) { - if (coding_method[ch][sb][j] < 10) - coding_method[ch][sb][j] = 10; + for (j = 0; j < 64; j++) + if (sb >= 10) { + if (coding_method[ch][sb][j] < 10) + coding_method[ch][sb][j] = 10; + } else { + if (sb >= 2) { + if (coding_method[ch][sb][j] < 16) + coding_method[ch][sb][j] = 16; } else { - if (sb >= 2) { - if (coding_method[ch][sb][j] < 16) - coding_method[ch][sb][j] = 16; - } else { - if (coding_method[ch][sb][j] < 30) - coding_method[ch][sb][j] = 30; - } + if (coding_method[ch][sb][j] < 30) + coding_method[ch][sb][j] = 30; } + } } else { // superblocktype_2_3 != 0 for (ch = 0; ch < nb_channels; ch++) for (sb = 0; sb < 30; sb++) -- 2.7.4