Patch by Daniel Jakots.
value = random();
gethostname(name, MAX_MESSAGE_ID);
- snprintf(id, MAX_MESSAGE_ID, "etPan.%lx.%lx.%x@%s",
- now, value, getpid(), name);
+ snprintf(id, MAX_MESSAGE_ID, "etPan.%llx.%lx.%x@%s",
+ (long long)now, value, getpid(), name);
return strdup(id);
}
MAP_SHARED, folder->mb_fd, 0);
if (str == MAP_FAILED) {
perror("mmap");
- debug_print("map of %lu bytes failed\n", buf.st_size);
+ debug_print("map of %lld bytes failed\n", (long long)buf.st_size);
res = MAILMBOX_ERROR_FILE;
goto err;
}
gchar enc_userid[256], enc_passwd[256];
gchar enable, use_host, use_port;
gsize len;
-#ifdef G_OS_WIN32
+#if defined(G_OS_WIN32) || defined(__OpenBSD__)
/* Windows sscanf() does not understand the %ms format yet, so we
* have to do the allocation of target buffer ourselves before
* calling sscanf(), and copy the host string to config->host.
if (confstr == NULL)
return config;
-#ifdef G_OS_WIN32
+#if defined(G_OS_WIN32) || defined(__OpenBSD__)
sscanf(confstr, "%c%c %255s %c%hu %hhu %hhu %hhu %255s %255s",
#else
sscanf(confstr, "%c%c %ms %c%hu %hhu %hhu %hhu %255s %255s",
#endif
&enable, &use_host,
-#ifdef G_OS_WIN32
+#if defined(G_OS_WIN32) || defined(__OpenBSD__)
tmphost,
#else
&config->host,
enc_userid,
enc_passwd);
-#ifdef G_OS_WIN32
+#if defined(G_OS_WIN32) || defined(__OpenBSD__)
config->host = g_strndup(tmphost, 255);
#endif
/* Last-Seen timestamp */
if( !strcmp(line[0], "X-RSSyl-Last-Seen") ) {
ctx->last_seen = atol(line[1]);
- debug_print("RSSyl: got last_seen timestamp %ld\n", ctx->last_seen);
+ debug_print("RSSyl: got last_seen timestamp %lld\n", (long long)ctx->last_seen);
}
/* ID */
fprintf(f, "X-RSSyl-URL: %s\n", tmpurl);
if( ritem->last_update > 0) {
- fprintf(f, "X-RSSyl-Last-Seen: %ld\n", ritem->last_update);
+ fprintf(f, "X-RSSyl-Last-Seen: %lld\n", (long long)ritem->last_update);
}
/* Message-ID */
err |= (fprintf(f,
"ID: %s\n"
"TITLE: %s\n"
- "DPUB: %ld\n"
- "DMOD: %ld\n",
+ "DPUB: %lld\n"
+ "DMOD: %lld\n",
ditem->id, ditem->title,
- ditem->date_published, ditem->date_modified) < 0);
+ (long long)ditem->date_published,
+ (long long)ditem->date_modified) < 0);
if (err)
debug_print("RSSyl: Error during writing deletion file.\n");
}
item->mtime = s.st_mtime;
- debug_print("VCAL: forced mtime of %s to %ld\n", item->name?item->name:"(null)", item->mtime);
+ debug_print("VCAL: forced mtime of %s to %lld\n",
+ item->name?item->name:"(null)", (long long)item->mtime);
g_free(path);
}
xml_tag_add_attr(tag, xml_attr_new("type", tmp));
g_free(tmp);
- tmp = g_strdup_printf("%lu", event->postponed);
+ tmp = g_strdup_printf("%lld", (long long)event->postponed);
xml_tag_add_attr(tag, xml_attr_new("postponed", tmp));
g_free(tmp);
list = vcal_folder_get_waiting_events();
for (cur = list; cur; cur = cur->next) {
VCalEvent *event = (VCalEvent *)cur->data;
- file = g_strdup_printf("multisync%lu-%d", time(NULL), i);
+ file = g_strdup_printf("multisync%lld-%d",
+ (long long)time(NULL), i);
i++;