server: Convert com_mvatt() to lopsub.
[paraslash.git] / ogg_afh_common.c
index e49b803b4e7a0e6492161d7be5c2b2fa21a16a09..6e5a89347e383340f943e591254f64f05cc6f358 100644 (file)
@@ -127,19 +127,18 @@ int ogg_get_file_info(char *map, size_t numbytes, struct afh_info *afhi,
 {
        ogg_sync_state oss;
        ogg_page op;
-       long len = numbytes;
        char *buf;
        int ret, i, j, frames_per_chunk, ct_size;
        long long unsigned num_frames = 0;
 
        ogg_sync_init(&oss);
        ret = -E_OGG_SYNC;
-       buf = ogg_sync_buffer(&oss, len);
+       buf = ogg_sync_buffer(&oss, numbytes);
        if (!buf)
                goto out;
-       memcpy(buf, map, len);
+       memcpy(buf, map, numbytes);
        ret = -E_OGG_SYNC;
-       if (ogg_sync_wrote(&oss, len) < 0)
+       if (ogg_sync_wrote(&oss, numbytes) < 0)
                goto out;
        ret = process_ogg_packets(&oss, afhi, ci);
        if (ret < 0)
@@ -193,7 +192,7 @@ static int write_ogg_page(int fd, const ogg_page *op)
 {
        int ret;
 
-       PARA_DEBUG_LOG("header/body: %lu/%lu\n", op->header_len, op->body_len);
+       PARA_DEBUG_LOG("header/body: %li/%li\n", op->header_len, op->body_len);
        ret = xwrite(fd, (const char *)op->header, op->header_len);
        if (ret < 0)
                return ret;
@@ -288,7 +287,7 @@ int ogg_rewrite_tags(const char *map, size_t map_sz, int fd,
                                goto out;
                        continue;
                }
-               PARA_DEBUG_LOG("packet: bytes: %d, granule: %d, packetno: %u\n",
+               PARA_DEBUG_LOG("packet: bytes: %d, granule: %d, packetno: %d\n",
                        (int)packet.bytes, (int)packet.granulepos,
                        (int)packet.packetno);
                /* ignore meta data packet which we replaced */
@@ -309,7 +308,7 @@ int ogg_rewrite_tags(const char *map, size_t map_sz, int fd,
 #endif
                        if (ret <= 0)
                                break;
-                       PARA_DEBUG_LOG("writing page (%lu bytes)\n",
+                       PARA_DEBUG_LOG("writing page (%li bytes)\n",
                                op.header_len + op.body_len);
                        ret = write_ogg_page(fd, &op);
                        if (ret < 0)