]> git.pld-linux.org Git - packages/zoneminder.git/blame - zoneminder-types.patch
- more c++ related build fixes
[packages/zoneminder.git] / zoneminder-types.patch
CommitLineData
708cf0df
JB
1--- ZoneMinder-1.28.0/src/zm_buffer.h.orig 2014-10-18 22:23:13.000000000 +0200
2+++ ZoneMinder-1.28.0/src/zm_buffer.h 2017-04-14 21:31:30.662591552 +0200
3@@ -145,7 +145,7 @@
4 {
5 return( append( buffer.mHead, buffer.mSize ) );
6 }
7- void tidy( bool level=0 )
8+ void tidy( int level=0 )
9 {
10 if ( mHead != mStorage )
11 {
12--- ZoneMinder-1.28.0/src/zm_rtsp.cpp.orig 2014-10-18 22:23:13.000000000 +0200
13+++ ZoneMinder-1.28.0/src/zm_rtsp.cpp 2017-04-14 21:45:07.582828745 +0200
14@@ -464,7 +464,7 @@
15
16 for ( size_t i = 0; i < lines.size(); i++ )
17 {
18- sscanf( lines[i].c_str(), "Session: %a[0-9a-fA-F]; timeout=%d", &session, &timeout );
19+ sscanf( lines[i].c_str(), "Session: %m[0-9a-fA-F]; timeout=%d", &session, &timeout );
20 sscanf( lines[i].c_str(), "Transport: %s", transport );
21 }
22
23@@ -542,7 +542,7 @@
24 char *rtpInfo = 0;
25 for ( size_t i = 0; i < lines.size(); i++ )
26 {
27- sscanf( lines[i].c_str(), "RTP-Info: %as", &rtpInfo );
28+ sscanf( lines[i].c_str(), "RTP-Info: %ms", &rtpInfo );
29 }
30
31 if ( !rtpInfo )
32--- ZoneMinder-1.28.0/xlib_shm-0.6.3/xlib_shm.c.orig 2017-04-14 21:16:44.882261246 +0200
33+++ ZoneMinder-1.28.0/xlib_shm-0.6.3/xlib_shm.c 2017-04-14 21:48:04.331529494 +0200
34@@ -55,6 +55,7 @@
35 #include <stdlib.h>
36 #include <unistd.h>
37 #include <X11/Xlib.h>
38+#include <X11/Xutil.h>
39 #include <stdbool.h>
40 #include <math.h>
41 #include <sys/shm.h>
42@@ -472,7 +473,7 @@
43 free(password);
44 free(database);
45
46- fprintf(stdout,"imgx=%d imgy=%d\ndelay=%d\nshmkey=%x\n",imgx,imgy,delay,shm_key);
47+ fprintf(stdout,"imgx=%d imgy=%d\ndelay=%ld\nshmkey=%llx\n",imgx,imgy,delay,shm_key);
48 fprintf(stdout,"monitors:");
49 cam=0;
50 while(cam<cam_num)
51--- ZoneMinder-1.28.0/src/zm_logger.cpp.orig 2014-10-18 22:23:13.000000000 +0200
52+++ ZoneMinder-1.28.0/src/zm_logger.cpp 2017-04-14 22:39:58.317336882 +0200
53@@ -509,7 +509,7 @@
54 #endif
55 char *timePtr = timeString;
56 timePtr += strftime( timePtr, sizeof(timeString), "%x %H:%M:%S", localtime(&timeVal.tv_sec) );
57- snprintf( timePtr, sizeof(timeString)-(timePtr-timeString), ".%06ld", timeVal.tv_usec );
58+ snprintf( timePtr, sizeof(timeString)-(timePtr-timeString), ".%06ld", (long)timeVal.tv_usec );
59 #if 0
60 }
61 #endif
62@@ -569,7 +569,7 @@
63 char escapedString[(strlen(syslogStart)*2)+1];
64
65 mysql_real_escape_string( &mDbConnection, escapedString, syslogStart, strlen(syslogStart) );
66- snprintf( sql, sizeof(sql), "insert into Logs ( TimeKey, Component, Pid, Level, Code, Message, File, Line ) values ( %ld.%06ld, '%s', %d, %d, '%s', '%s', '%s', %d )", timeVal.tv_sec, timeVal.tv_usec, mId.c_str(), tid, level, classString, escapedString, file, line );
67+ snprintf( sql, sizeof(sql), "insert into Logs ( TimeKey, Component, Pid, Level, Code, Message, File, Line ) values ( %lld.%06ld, '%s', %d, %d, '%s', '%s', '%s', %d )", (long long)timeVal.tv_sec, (long)timeVal.tv_usec, mId.c_str(), tid, level, classString, escapedString, file, line );
68 if ( mysql_query( &mDbConnection, sql ) )
69 {
70 databaseLevel( NOLOG );
71--- ZoneMinder-1.28.0/src/zm_event.cpp.orig 2014-10-18 22:23:13.000000000 +0200
72+++ ZoneMinder-1.28.0/src/zm_event.cpp 2017-04-14 22:44:18.196788194 +0200
73@@ -74,7 +74,7 @@
74 static char sql[ZM_SQL_MED_BUFSIZ];
75
76 struct tm *stime = localtime( &start_time.tv_sec );
77- snprintf( sql, sizeof(sql), "insert into Events ( MonitorId, Name, StartTime, Width, Height, Cause, Notes ) values ( %d, 'New Event', from_unixtime( %ld ), %d, %d, '%s', '%s' )", monitor->Id(), start_time.tv_sec, monitor->Width(), monitor->Height(), cause.c_str(), notes.c_str() );
78+ snprintf( sql, sizeof(sql), "insert into Events ( MonitorId, Name, StartTime, Width, Height, Cause, Notes ) values ( %d, 'New Event', from_unixtime( %lld ), %d, %d, '%s', '%s' )", monitor->Id(), (long long)start_time.tv_sec, monitor->Width(), monitor->Height(), cause.c_str(), notes.c_str() );
79 if ( mysql_query( &dbconn, sql ) )
80 {
81 Error( "Can't insert event: %s", mysql_error( &dbconn ) );
82@@ -172,7 +172,7 @@
83
84 Debug( 1, "Adding closing frame %d to DB", frames );
85 static char sql[ZM_SQL_SML_BUFSIZ];
86- snprintf( sql, sizeof(sql), "insert into Frames ( EventId, FrameId, TimeStamp, Delta ) values ( %d, %d, from_unixtime( %ld ), %s%ld.%02ld )", id, frames, end_time.tv_sec, delta_time.positive?"":"-", delta_time.sec, delta_time.fsec );
87+ snprintf( sql, sizeof(sql), "insert into Frames ( EventId, FrameId, TimeStamp, Delta ) values ( %d, %d, from_unixtime( %lld ), %s%ld.%02ld )", id, frames, (long long) end_time.tv_sec, delta_time.positive?"":"-", delta_time.sec, delta_time.fsec );
88 if ( mysql_query( &dbconn, sql ) )
89 {
90 Error( "Can't insert frame: %s", mysql_error( &dbconn ) );
91@@ -185,7 +185,7 @@
92 struct DeltaTimeval delta_time;
93 DELTA_TIMEVAL( delta_time, end_time, start_time, DT_PREC_2 );
94
95- snprintf( sql, sizeof(sql), "update Events set Name='%s%d', EndTime = from_unixtime( %ld ), Length = %s%ld.%02ld, Frames = %d, AlarmFrames = %d, TotScore = %d, AvgScore = %d, MaxScore = %d where Id = %d", monitor->EventPrefix(), id, end_time.tv_sec, delta_time.positive?"":"-", delta_time.sec, delta_time.fsec, frames, alarm_frames, tot_score, (int)(alarm_frames?(tot_score/alarm_frames):0), max_score, id );
96+ snprintf( sql, sizeof(sql), "update Events set Name='%s%d', EndTime = from_unixtime( %lld ), Length = %s%ld.%02ld, Frames = %d, AlarmFrames = %d, TotScore = %d, AvgScore = %d, MaxScore = %d where Id = %d", monitor->EventPrefix(), id, (long long) end_time.tv_sec, delta_time.positive?"":"-", delta_time.sec, delta_time.fsec, frames, alarm_frames, tot_score, (int)(alarm_frames?(tot_score/alarm_frames):0), max_score, id );
97 if ( mysql_query( &dbconn, sql ) )
98 {
99 Error( "Can't update event: %s", mysql_error( &dbconn ) );
100@@ -520,7 +520,7 @@
101 DELTA_TIMEVAL( delta_time, *(timestamps[i]), start_time, DT_PREC_2 );
102
103 int sql_len = strlen(sql);
104- snprintf( sql+sql_len, sizeof(sql)-sql_len, "( %d, %d, from_unixtime(%ld), %s%ld.%02ld ), ", id, frames, timestamps[i]->tv_sec, delta_time.positive?"":"-", delta_time.sec, delta_time.fsec );
105+ snprintf( sql+sql_len, sizeof(sql)-sql_len, "( %d, %d, from_unixtime(%lld), %s%ld.%02ld ), ", id, frames, (long long)timestamps[i]->tv_sec, delta_time.positive?"":"-", delta_time.sec, delta_time.fsec );
106
107 frameCount++;
108 }
109@@ -569,7 +569,7 @@
110
111 Debug( 1, "Adding frame %d to DB", frames );
112 static char sql[ZM_SQL_MED_BUFSIZ];
113- snprintf( sql, sizeof(sql), "insert into Frames ( EventId, FrameId, Type, TimeStamp, Delta, Score ) values ( %d, %d, '%s', from_unixtime( %ld ), %s%ld.%02ld, %d )", id, frames, frame_type, timestamp.tv_sec, delta_time.positive?"":"-", delta_time.sec, delta_time.fsec, score );
114+ snprintf( sql, sizeof(sql), "insert into Frames ( EventId, FrameId, Type, TimeStamp, Delta, Score ) values ( %d, %d, '%s', from_unixtime( %lld ), %s%ld.%02ld, %d )", id, frames, frame_type, (long long)timestamp.tv_sec, delta_time.positive?"":"-", delta_time.sec, delta_time.fsec, score );
115 if ( mysql_query( &dbconn, sql ) )
116 {
117 Error( "Can't insert frame: %s", mysql_error( &dbconn ) );
118@@ -656,7 +656,7 @@
119 {
120 static char sql[ZM_SQL_SML_BUFSIZ];
121
122- snprintf( sql, sizeof(sql), "select Id from Events where MonitorId = %d and unix_timestamp( EndTime ) > %ld order by Id asc limit 1", monitor_id, event_time );
123+ snprintf( sql, sizeof(sql), "select Id from Events where MonitorId = %d and unix_timestamp( EndTime ) > %lld order by Id asc limit 1", monitor_id, (long long)event_time );
124
125 if ( mysql_query( &dbconn, sql ) )
126 {
127--- ZoneMinder-1.28.0/src/zm_monitor.cpp.orig 2014-10-18 22:23:13.000000000 +0200
128+++ ZoneMinder-1.28.0/src/zm_monitor.cpp 2017-04-14 22:44:52.005118045 +0200
129@@ -2949,7 +2949,7 @@
130 found_macro = true;
131 break;
132 case 'f' :
133- d_ptr += snprintf( d_ptr, sizeof(label_text)-(d_ptr-label_text), "%02ld", ts_time->tv_usec/10000 );
134+ d_ptr += snprintf( d_ptr, sizeof(label_text)-(d_ptr-label_text), "%02ld", (long)(ts_time->tv_usec/10000) );
135 found_macro = true;
136 break;
137 }
138--- ZoneMinder-1.28.0/src/zmu.cpp.orig 2014-10-18 22:23:13.000000000 +0200
139+++ ZoneMinder-1.28.0/src/zmu.cpp 2017-04-14 22:47:07.361776851 +0200
140@@ -444,14 +444,14 @@
141 if ( timestamp.tv_sec )
142 strftime( timestamp_str, sizeof(timestamp_str), "%Y-%m-%d %H:%M:%S", localtime( &timestamp.tv_sec ) );
143 if ( image_idx == -1 )
144- printf( "Time of last image capture: %s.%02ld\n", timestamp_str, timestamp.tv_usec/10000 );
145+ printf( "Time of last image capture: %s.%02ld\n", timestamp_str, (long)(timestamp.tv_usec/10000) );
146 else
147- printf( "Time of image %d capture: %s.%02ld\n", image_idx, timestamp_str, timestamp.tv_usec/10000 );
148+ printf( "Time of image %d capture: %s.%02ld\n", image_idx, timestamp_str, (long)(timestamp.tv_usec/10000) );
149 }
150 else
151 {
152 if ( have_output ) printf( "%c", separator );
153- printf( "%ld.%02ld", timestamp.tv_sec, timestamp.tv_usec/10000 );
154+ printf( "%lld.%02ld", (long long)timestamp.tv_sec, (long)(timestamp.tv_usec/10000) );
155 have_output = true;
156 }
157 }
158@@ -718,12 +718,12 @@
159 if ( monitor )
160 {
161 struct timeval tv = monitor->GetTimestamp();
162- printf( "%4d%5d%6d%9d%11ld.%02ld%6d%6d%8d%8.2f\n",
163+ printf( "%4d%5d%6d%9d%11lld.%02ld%6d%6d%8d%8.2f\n",
164 monitor->Id(),
165 function,
166 monitor->GetState(),
167 monitor->GetTriggerState(),
168- tv.tv_sec, tv.tv_usec/10000,
169+ (long long)tv.tv_sec, (long)(tv.tv_usec/10000),
170 monitor->GetLastReadIndex(),
171 monitor->GetLastWriteIndex(),
172 monitor->GetLastEvent(),
173@@ -735,12 +735,12 @@
174 else
175 {
176 struct timeval tv = { 0, 0 };
177- printf( "%4d%5d%6d%9d%11ld.%02ld%6d%6d%8d%8.2f\n",
178+ printf( "%4d%5d%6d%9d%11lld.%02ld%6d%6d%8d%8.2f\n",
179 mon_id,
180 function,
181 0,
182 0,
183- tv.tv_sec, tv.tv_usec/10000,
184+ (long long)tv.tv_sec, (long)(tv.tv_usec/10000),
185 0,
186 0,
187 0,
This page took 0.098312 seconds and 4 git commands to generate.