Format **/*.c with clang-format (!465)
[ci:skip-build]: already built successfully in CI [ci:skip-vercheck]
This commit is contained in:
parent
90e2cc7eff
commit
a66fed62cc
@ -63,4 +63,4 @@ package() {
|
||||
done
|
||||
done
|
||||
}
|
||||
sha512sums="f8366add6ba2ac6d9f8af89f389c69914009b12b21e6608121a78d1cd9afe287e24eafb0c21d80d096df9eee9a23cc2e6a5408f6355e27be05203186a0bf9814 crossdirect.c"
|
||||
sha512sums="20b963322820de038257304c1eefa85767b78e242eda7459f06d70a1cfae5540a445aa7d5587024bf4d88a4bee28120ef9f5c2d24a648e71b542b9618318deb2 crossdirect.c"
|
||||
|
@ -1,24 +1,26 @@
|
||||
// HOSTSPEC is defined at compile time, see APKBUILD
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdbool.h>
|
||||
#include <libgen.h>
|
||||
#include <errno.h>
|
||||
#include <libgen.h>
|
||||
#include <limits.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#define NATIVE_BIN_DIR "/native/usr/lib/ccache/bin"
|
||||
|
||||
void exit_userfriendly() {
|
||||
void exit_userfriendly()
|
||||
{
|
||||
fprintf(stderr, "Please report this at: https://gitlab.com/postmarketOS/pmaports/issues\n");
|
||||
fprintf(stderr, "As a workaround, you can compile without crossdirect.\n");
|
||||
fprintf(stderr, "See 'pmbootstrap -h' for related options.\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
bool argv_has_arg(int argc, char** argv, const char* arg) {
|
||||
bool argv_has_arg(int argc, char **argv, const char *arg)
|
||||
{
|
||||
size_t arg_len = strlen(arg);
|
||||
|
||||
for (int i = 1; i < argc; i++) {
|
||||
@ -31,7 +33,8 @@ bool argv_has_arg(int argc, char** argv, const char* arg) {
|
||||
return false;
|
||||
}
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
// we have a max of four extra args ("-target", "HOSTSPEC", "--sysroot=/", "-Wl,-rpath-link=/lib:/usr/lib"), plus one ending null
|
||||
char *newargv[argc + 5];
|
||||
char *executableName = basename(argv[0]);
|
||||
|
@ -22,4 +22,4 @@ package() {
|
||||
"${pkgdir}/usr/sbin/fbdebug"
|
||||
}
|
||||
|
||||
sha512sums="c75972faa180567fccabf63723693a3dfe6240f891eee9d580a1bfce2a8858cb746a4cc9704990f90abe94f3759ac47ca5203f1309e525d880a8663235a7e209 fbdebug.c"
|
||||
sha512sums="c2b99024d4d3f1a47b5dcdff175b611d3c16175553076badafdaf9628ed85f95d955d09366a25d34a0f63a00c58bbdd063f6f531f60254b20420d47d7e3adb2f fbdebug.c"
|
||||
|
@ -15,15 +15,15 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include <fcntl.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <linux/fb.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <unistd.h>
|
||||
|
||||
void usage(char *appname)
|
||||
{
|
||||
@ -36,7 +36,8 @@ void usage(char* appname)
|
||||
2 => Standby\n\
|
||||
3 => Suspend\n\
|
||||
4 => Off\n\
|
||||
-h Show this help\n", appname);
|
||||
-h Show this help\n",
|
||||
appname);
|
||||
}
|
||||
|
||||
void print_fix_screeninfo(struct fb_fix_screeninfo *scr_fix)
|
||||
@ -164,16 +165,13 @@ int main(int argc, char** argv)
|
||||
bool set_fbmode = false;
|
||||
int fbmode;
|
||||
|
||||
if (argc < 2)
|
||||
{
|
||||
if (argc < 2) {
|
||||
usage(argv[0]);
|
||||
exit(1);
|
||||
}
|
||||
int opt;
|
||||
while ((opt = getopt(argc, argv, "d:ic:pm:h")) != -1)
|
||||
{
|
||||
switch (opt)
|
||||
{
|
||||
while ((opt = getopt(argc, argv, "d:ic:pm:h")) != -1) {
|
||||
switch (opt) {
|
||||
case 'd':
|
||||
fb_device = optarg;
|
||||
break;
|
||||
@ -200,15 +198,13 @@ int main(int argc, char** argv)
|
||||
|
||||
// open the framebuffer device
|
||||
fb_fd = open(fb_device, O_RDWR);
|
||||
if (fb_fd < 0)
|
||||
{
|
||||
if (fb_fd < 0) {
|
||||
printf("Unable to open %s.\n", fb_device);
|
||||
return 1;
|
||||
}
|
||||
|
||||
// call ioctl. retrieve fixed screen info
|
||||
if (ioctl(fb_fd, FBIOGET_FSCREENINFO, &scr_fix) < 0)
|
||||
{
|
||||
if (ioctl(fb_fd, FBIOGET_FSCREENINFO, &scr_fix) < 0) {
|
||||
printf("Unable to retrieve fixed screen info: %s\n",
|
||||
strerror(errno));
|
||||
close(fb_fd);
|
||||
@ -220,8 +216,7 @@ int main(int argc, char** argv)
|
||||
print_fix_screeninfo(&scr_fix);
|
||||
|
||||
// call ioctl. retrieve variable screen info
|
||||
if (ioctl(fb_fd, FBIOGET_VSCREENINFO, &scr_var) < 0)
|
||||
{
|
||||
if (ioctl(fb_fd, FBIOGET_VSCREENINFO, &scr_var) < 0) {
|
||||
printf("Unable to retrieve variable screen info: %s\n",
|
||||
strerror(errno));
|
||||
close(fb_fd);
|
||||
@ -240,8 +235,7 @@ int main(int argc, char** argv)
|
||||
scr_cmap.green = calloc(256, sizeof(unsigned short));
|
||||
scr_cmap.blue = calloc(256, sizeof(unsigned short));
|
||||
scr_cmap.transp = calloc(256, sizeof(unsigned short));
|
||||
if (ioctl(fb_fd, FBIOGETCMAP, &scr_cmap) < 0)
|
||||
{
|
||||
if (ioctl(fb_fd, FBIOGETCMAP, &scr_cmap) < 0) {
|
||||
printf("Unable to retrieve cmap info: %s\n",
|
||||
strerror(errno));
|
||||
free(scr_cmap.red);
|
||||
@ -261,11 +255,9 @@ int main(int argc, char** argv)
|
||||
free(scr_cmap.transp);
|
||||
}
|
||||
|
||||
if (pan_display)
|
||||
{
|
||||
if (pan_display) {
|
||||
// call ioctl. pan the display
|
||||
if (ioctl(fb_fd, FBIOPAN_DISPLAY, &scr_var) < 0)
|
||||
{
|
||||
if (ioctl(fb_fd, FBIOPAN_DISPLAY, &scr_var) < 0) {
|
||||
printf("Unable to pan the display: %s\n",
|
||||
strerror(errno));
|
||||
close(fb_fd);
|
||||
@ -274,8 +266,7 @@ int main(int argc, char** argv)
|
||||
}
|
||||
|
||||
if (set_fbmode) {
|
||||
if (ioctl(fb_fd, FBIOBLANK, (void *)fbmode) < 0)
|
||||
{
|
||||
if (ioctl(fb_fd, FBIOBLANK, (void *)fbmode) < 0) {
|
||||
printf("Unable to set fb mode: %s\n",
|
||||
strerror(errno));
|
||||
close(fb_fd);
|
||||
|
@ -27,5 +27,5 @@ package() {
|
||||
install -D -m755 "$srcdir"/hello-world \
|
||||
"$pkgdir"/usr/bin/hello-world
|
||||
}
|
||||
sha512sums="d5ad91600d9be3e53be4cb6e5846b0757786c947b2c0d10f612f67262fc91c148e8d73621623e259ca9dcd5e2c8ec7069cebec44165e203ea8c0133669d3382d main.c
|
||||
sha512sums="62385af6a68cd4e0c03b15992bb9f1d20b8d6c8a33724ca2d28629a139e95016d0502257f8a3a8be53eef30e11b3e372a2469cb1989dbd387ebea4464a9273ee main.c
|
||||
80c32948d3254f5e4f9084d73754824e7d7d7d117770b041a1a13baf056773de265153fe518cc3e735db55b638411aa6fbd0e17b5b674dfc89e69a9391fbd3bb Makefile"
|
||||
|
@ -36,7 +36,7 @@ package() {
|
||||
}
|
||||
sha512sums="cd3c4a4bb246d8e2480a9968d3519373ab55126a5b77e975ce53333ed39349194f1afb0dea472d62bdb0ffef1ac93bbadaf3de6362db47ef34c922a1e65c95db build_zip.sh
|
||||
bb152e86ce420761dd2dca660552131610bb8f39cb7e30c75689aacc7cccddce17a90c998097f1b63b3d68a20f9c2c4823d8d591de156dff827381fe436f3b9d update-binary
|
||||
38c21dc80aa2530fc06c2960c1318e07d068d403af02133f09ba227106a9b23fb77c3bed904e6135b048846f2733bd5d043235e5ab04598ed9c8fa45cbb15586 disable-warning.c
|
||||
3e6388602665367990bdf4c068268160c26a80dda7fa43380755f36f1ca8751f4ec8a584a4cce3b37f41d405a992716c4280077d062e186b4027d6b74db84b3c disable-warning.c
|
||||
2400d18734d08b3d2f5ec2fe4e802cdcacddea851644b47505eff1aac47302699c171b880bca55dd1704cc9cef9ac26082ac89cee802b6bf57ff8cf649373328 pmos_chroot
|
||||
ef6377f6c062b9a86eb9dfb2aa2c0049fda20f24ec75865a682a50e4655710a18bd7a470deab527e1dd4c273f9ea6a003ec03fc5748d44b1c4fbfc91baa9e358 pmos_install
|
||||
1b19d507a9142e537d052037a0c0768f064ad9131ac8019b234178dc15c0590dbc549ccf553b7a7d55e977df269d4dc0567b520c890738cb80184fc8235222aa pmos_install_functions
|
||||
|
@ -17,14 +17,14 @@
|
||||
* along with postmarketos-android-recovery-installer. If not, see <http:www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <dirent.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <string.h>
|
||||
#include <fcntl.h>
|
||||
#include <dirent.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
void close_FDs()
|
||||
{
|
||||
|
@ -20,5 +20,5 @@ package() {
|
||||
install -D -m755 "$srcdir"/postmarketos-demos \
|
||||
"$pkgdir"/usr/bin/postmarketos-demos
|
||||
}
|
||||
sha512sums="48db2907ea609bcdafd321aa8659a387ad6325641e01fd83d91be5d320eb6202ab628b73d914658333396e7751e1e283aed413db7e91cce2d782993ef38a7e05 main.c
|
||||
sha512sums="804bbd4e939bd49a153919a728ee17cf69e98e5d679f106054edf298d775849f8efa4716814ee4b84eaa6bcc2c38d16c2362922978cdd214290dd4968ce645bc main.c
|
||||
83d8a95e9e1e95dffa8661e547444e83e72e572dcd0c637376f678bbd20a351c4b971a315311edefeb58a4cca14fd3e586fb581a262b2d217e25092459539b98 Makefile"
|
||||
|
@ -34,8 +34,7 @@ static void activate(GtkApplication *app, gpointer user_data)
|
||||
"killall weston &",
|
||||
};
|
||||
|
||||
for(int i=0;i<(sizeof(programs) / sizeof(const char*));i+=2)
|
||||
{
|
||||
for (int i = 0; i < (sizeof(programs) / sizeof(const char *)); i += 2) {
|
||||
const char *title = programs[i];
|
||||
const char *command = programs[i + 1];
|
||||
|
||||
|
@ -22,4 +22,4 @@ package() {
|
||||
"${pkgdir}/usr/sbin/reboot-mode"
|
||||
}
|
||||
|
||||
sha512sums="569b6b1cf595e208b8c5731ea8d4334cd5458cbc2a63d5756014f55f04dd89a4b67ec0d0d01d7a1cd935ae13d44e62e3ea6765f626736bc3dc2029b890c20070 reboot-mode.c"
|
||||
sha512sums="37d282608f30b1b8fa4f7501a8afcaa81902c9dfaee0c4c92ab05028e3a99a69c601dc7fce6ab06582db044b6fd0f5bffabe9d6064af9e670266978d66fe2515 reboot-mode.c"
|
||||
|
@ -4,12 +4,12 @@
|
||||
*
|
||||
* Copyright (C) 2019 Daniele Debernardi <drebrez@gmail.com>
|
||||
*/
|
||||
#include <linux/reboot.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/syscall.h>
|
||||
#include <linux/reboot.h>
|
||||
#include <unistd.h>
|
||||
|
||||
void usage(char *appname)
|
||||
{
|
||||
@ -22,17 +22,14 @@ void usage(char* appname)
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
if (argc != 2)
|
||||
{
|
||||
if (argc != 2) {
|
||||
usage(argv[0]);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
int opt;
|
||||
while ((opt = getopt(argc, argv, "h")) != -1)
|
||||
{
|
||||
switch (opt)
|
||||
{
|
||||
while ((opt = getopt(argc, argv, "h")) != -1) {
|
||||
switch (opt) {
|
||||
case 'h':
|
||||
default:
|
||||
usage(argv[0]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user