瀏覽代碼

[misc] Fix building on OpenBSD

OpenBSD throws compiler warnings that we can't reproduce on Linux, for
some reason.

Original patch from Dewey Hylton <dewey@hyltown.com>.
tags/v0.9.4
Michael Brown 16 年之前
父節點
當前提交
2596a9aa9c
共有 2 個檔案被更改,包括 3 行新增4 行删除
  1. 2
    3
      src/image/embedded.c
  2. 1
    1
      src/interface/pxe/pxe_tftp.c

+ 2
- 3
src/image/embedded.c 查看文件

@@ -4,7 +4,6 @@
4 4
  * data structure.
5 5
  */
6 6
 
7
-#include <stdio.h>
8 7
 #include <gpxe/image.h>
9 8
 #include <gpxe/malloc.h>
10 9
 #include <gpxe/uaccess.h>
@@ -25,8 +24,8 @@ struct image *embedded_image(void)
25 24
 	if ( reclaimed )
26 25
 		return NULL;	/* Already reclaimed */
27 26
 
28
-	printf("Embedded image: %d bytes at %p\n",
29
-	       eisize, _embedded_image_start);
27
+	DBG ( "Embedded image: %zd bytes at %p\n",
28
+	      eisize, _embedded_image_start );
30 29
 
31 30
 	image = alloc_image();
32 31
 	if (!image)

+ 1
- 1
src/interface/pxe/pxe_tftp.c 查看文件

@@ -189,7 +189,7 @@ static int pxe_tftp_open ( uint32_t ipaddress, unsigned int port,
189 189
 	if ( blksize < TFTP_DEFAULT_BLKSIZE )
190 190
 		blksize = TFTP_DEFAULT_BLKSIZE;
191 191
 	snprintf ( uri_string, sizeof ( uri_string ),
192
-		   "tftp://%s:%d%s%s?blksize=%d",
192
+		   "tftp://%s:%d%s%s?blksize=%zd",
193 193
 		   inet_ntoa ( address ), ntohs ( port ),
194 194
 		   ( ( filename[0] == '/' ) ? "" : "/" ), filename, blksize );
195 195
 	DBG ( " %s", uri_string );

Loading…
取消
儲存