void-packages/srcpkgs/allegro5/patches/time64.patch
Đoàn Trần Công Danh ae69000001 srcpkgs/a*: convert patches to -Np1
* arduino and antiword is kept at -Np0

```sh

git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" |
while read template; do
	for p in ${template%/template}/patches/*; do
		sed -i '
			\,^[+-][+-][+-] /dev/null,b
			/^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b
			s,^[*][*][*] ,&a/,
			/^--- /{
				s,\(^--- \)\(./\)*,\1a/,
				s,[.][Oo][Rr][Ii][Gg]\([	/]\),\1,
				s/[.][Oo][Rr][Ii][Gg]$//
				s/[.]patched[.]\([^.]\)/.\1/
				h
			}
			/^+++ -/{
				g
				s/^--- a/+++ b/
				b
			}
			s,\(^+++ \)\(./\)*,\1b/,
		' "$p"
	done
	sed -i '/^patch_args=/d' $template
done
```
2021-06-20 13:17:29 +07:00

49 lines
1.2 KiB
Diff

--- a/src/linux/lhaptic.c 2015-06-01 21:58:12.000000000 +0200
+++ b/src/linux/lhaptic.c 2020-12-06 09:50:58.475010832 +0100
@@ -57,6 +57,7 @@
/* forward declarations */
+static void lhap_timerclear(struct input_event* event);
static bool lhap_init_haptic(void);
static void lhap_exit_haptic(void);
@@ -162,6 +163,11 @@
{ -1, -1 }
};
+static void lhap_timerclear(struct input_event* event)
+{
+ event->input_event_sec = 0;
+ event->input_event_usec = 0;
+}
static bool lhap_init_haptic(void)
{
@@ -622,7 +628,7 @@
struct input_event ie;
lhap->parent.gain = gain;
- timerclear(&ie.time);
+ lhap_timerclear(&ie);
ie.type = EV_FF;
ie.code = FF_GAIN;
ie.value = (__s32) ((double)0xFFFF * gain);
@@ -639,7 +645,7 @@
struct input_event ie;
lhap->parent.autocenter = autocenter;
- timerclear(&ie.time);
+ lhap_timerclear(&ie);
ie.type = EV_FF;
ie.code = FF_AUTOCENTER;
ie.value = (__s32) ((double)0xFFFF * autocenter);
@@ -765,7 +771,7 @@
fd = lhap->fd;
- timerclear(&play.time);
+ lhap_timerclear(&play);
play.type = EV_FF;
play.code = id->_handle;
loops = (loops < 0) ? 1 : loops;