From patchwork Wed Sep 20 17:59:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 76460 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A5E7F385DC1C for ; Wed, 20 Sep 2023 18:00:35 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) by sourceware.org (Postfix) with ESMTPS id 7E6F63857012 for ; Wed, 20 Sep 2023 18:00:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7E6F63857012 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-404571cbb8dso896955e9.3 for ; Wed, 20 Sep 2023 11:00:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695232820; x=1695837620; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=cdxoK6Zoij+BtzUXjvxcJqFtDIw+6yXP24IW3otQCsU=; b=K6/LLjkZtmgyU0k47dRBAvAYyJq24An1EO5b1vdiOUhTOxilTi564vuZ9iYYTwWf8C djjd8lbc3zjvtM6pPm3+Yul18FxrvO27VGhvMraR4KhkptAZ4bZ5CU/cRDjxZqL5OK/U 4WGGxw/20K8fvyu/KkfRqLw7DOGqT1ciGIvKsg/li0YFn/atCoGMkDjMRW82mY3EDoDu eu1eW0rbp5vjdKRGoa0aEWwo217VZZTFmcw6uBPNaYVRxOPonxDZmNOffqpNcJGEUv1H ZLSh2M7sh1rwzcyIgzgs55iq375whDJN3rrIcrUPQxRj34e7CFutZxOZv29VD48GRhgf MBUA== X-Gm-Message-State: AOJu0Ywn6TosUufPihglrW8tKc1d1t8/9FQBxpSj5jDFac24UvfJeaWd 78pMAzOKwpm3GxyCpHFZC+cbCYmpSdgdjw== X-Google-Smtp-Source: AGHT+IEFgzZK68LThiYcoTkipFFyoXFr0hf3tPP6sN+yPM7O62bX+zw4QQPrma4BBYlHhxQi3ez5hw== X-Received: by 2002:adf:f450:0:b0:31f:fae3:7629 with SMTP id f16-20020adff450000000b0031ffae37629mr3328402wrp.13.1695232819943; Wed, 20 Sep 2023 11:00:19 -0700 (PDT) Received: from localhost ([2001:8a0:f939:d200:f66d:9e3b:9c38:4aec]) by smtp.gmail.com with UTF8SMTPSA id l16-20020adffe90000000b0031aef72a021sm4605543wrr.86.2023.09.20.11.00.18 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 20 Sep 2023 11:00:19 -0700 (PDT) From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH 2/5] Fix gdb.threads/pthreads.c formatting Date: Wed, 20 Sep 2023 18:59:56 +0100 Message-Id: <20230920175959.2305271-3-pedro@palves.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230920175959.2305271-1-pedro@palves.net> References: <20230920175959.2305271-1-pedro@palves.net> MIME-Version: 1.0 X-Spam-Status: No, score=-9.7 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" Just some GNU formatting fixes throughout. Change-Id: Ie851e3815b839e57898263896db0ba8ddfefe09e --- gdb/testsuite/gdb.threads/pthreads.c | 45 +++++++++++++++++----------- 1 file changed, 27 insertions(+), 18 deletions(-) diff --git a/gdb/testsuite/gdb.threads/pthreads.c b/gdb/testsuite/gdb.threads/pthreads.c index 7ec5604676f..e1593e980ea 100644 --- a/gdb/testsuite/gdb.threads/pthreads.c +++ b/gdb/testsuite/gdb.threads/pthreads.c @@ -35,7 +35,8 @@ common_routine (int arg) static int hits; static int full_coverage; - if (verbose) printf("common_routine (%d)\n", arg); + if (verbose) + printf ("common_routine (%d)\n", arg); hits++; switch (arg) { @@ -59,13 +60,15 @@ thread1 (void *arg) int i; int z = 0; - if (verbose) printf ("thread1 (%0lx) ; pid = %d\n", (long) arg, getpid ()); - for (i=1; i <= 10000000; i++) + if (verbose) + printf ("thread1 (%0lx) ; pid = %d\n", (long) arg, getpid ()); + for (i = 1; i <= 10000000; i++) { - if (verbose) printf("thread1 %ld\n", (long) pthread_self ()); + if (verbose) + printf ("thread1 %ld\n", (long) pthread_self ()); z += i; common_routine (1); - sleep(1); + sleep (1); } return (void *) 0; } @@ -76,15 +79,17 @@ thread2 (void * arg) int i; int k = 0; - if (verbose) printf ("thread2 (%0lx) ; pid = %d\n", (long) arg, getpid ()); - for (i=1; i <= 10000000; i++) + if (verbose) + printf ("thread2 (%0lx) ; pid = %d\n", (long) arg, getpid ()); + for (i = 1; i <= 10000000; i++) { - if (verbose) printf("thread2 %ld\n", (long) pthread_self ()); + if (verbose) + printf ("thread2 %ld\n", (long) pthread_self ()); k += i; common_routine (2); - sleep(1); + sleep (1); } - sleep(100); + sleep (100); return (void *) 0; } @@ -93,7 +98,8 @@ foo (int a, int b, int c) { int d, e, f; - if (verbose) printf("a=%d\n", a); + if (verbose) + printf ("a=%d\n", a); } int @@ -105,7 +111,8 @@ main (int argc, char **argv) void (*xxx) (); pthread_attr_t attr; - if (verbose) printf ("pid = %d\n", getpid()); + if (verbose) + printf ("pid = %d\n", getpid ()); foo (1, 2, 3); @@ -128,7 +135,8 @@ main (int argc, char **argv) perror ("pthread_create 1"); exit (1); } - if (verbose) printf ("Made thread %ld\n", (long) tid1); + if (verbose) + printf ("Made thread %ld\n", (long) tid1); sleep (1); if (pthread_create (&tid2, NULL, thread2, (void *) 0xdeadbeef)) @@ -136,18 +144,19 @@ main (int argc, char **argv) perror ("pthread_create 2"); exit (1); } - if (verbose) printf("Made thread %ld\n", (long) tid2); + if (verbose) + printf ("Made thread %ld\n", (long) tid2); sleep (1); for (j = 1; j <= 10000000; j++) { - if (verbose) printf("top %ld\n", (long) pthread_self ()); + if (verbose) + printf ("top %ld\n", (long) pthread_self ()); common_routine (0); - sleep(1); + sleep (1); t += j; } - exit(0); + exit (0); } -