Back out c209fea124e1 (bug 754198) because of Win64 build failure

This commit is contained in:
Matt Brubeck 2012-05-11 13:23:49 -07:00
parent 21c8b3a653
commit f08ab73a53
11 changed files with 22 additions and 45 deletions

View File

@ -1234,10 +1234,10 @@ main(int argc, char *argv[])
munmap(mapping, size);
int result = ftruncate(fd, size - hole_len);
ftruncate(fd, size - hole_len);
close(fd);
return result == -1 ? 1 : 0;
return 0;
}

View File

@ -1354,12 +1354,12 @@ NPP_StreamAsFile(NPP instance, NPStream* stream, const char* fname)
FILE *file = fopen(fname, "rb");
if (file) {
ssize_t unused = fseek(file, 0, SEEK_END);
fseek(file, 0, SEEK_END);
size = ftell(file);
instanceData->fileBuf = malloc((int32_t)size + 1);
char* buf = reinterpret_cast<char *>(instanceData->fileBuf);
unused = fseek(file, 0, SEEK_SET);
unused = fread(instanceData->fileBuf, 1, size, file);
fseek(file, 0, SEEK_SET);
fread(instanceData->fileBuf, 1, size, file);
fclose(file);
buf[size] = '\0';
instanceData->fileBufSize = (int32_t)size;

View File

@ -1527,11 +1527,10 @@ wrtmessage(const char *p1, const char *p2, const char *p3, const char *p4)
#if defined(MOZ_MEMORY) && !defined(MOZ_MEMORY_WINDOWS)
#define _write write
#endif
int res;
res = _write(STDERR_FILENO, p1, (unsigned int) strlen(p1));
res = _write(STDERR_FILENO, p2, (unsigned int) strlen(p2));
res = _write(STDERR_FILENO, p3, (unsigned int) strlen(p3));
res = _write(STDERR_FILENO, p4, (unsigned int) strlen(p4));
_write(STDERR_FILENO, p1, (unsigned int) strlen(p1));
_write(STDERR_FILENO, p2, (unsigned int) strlen(p2));
_write(STDERR_FILENO, p3, (unsigned int) strlen(p3));
_write(STDERR_FILENO, p4, (unsigned int) strlen(p4));
}
#define _malloc_message malloc_message

View File

@ -126,9 +126,7 @@ int main(int argc, char **argv) {
break;
/* -C workingdirectory */
} else if (argv[1][0] == '-' && argv[1][1] == 'C') {
int res = chdir(argv[2]);
if (res == -1)
return -1;
chdir(argv[2]);
argv += 2;
argc -= 2;
}

View File

@ -88,10 +88,6 @@
#include "prlog.h"
#include "prtime.h"
#include "mozilla/unused.h"
using mozilla::unused;
namespace TestProtocols {
#if defined(PR_LOGGING)
@ -342,7 +338,7 @@ TestAuthPrompt::PromptUsernameAndPassword(const PRUnichar *dialogTitle,
int n;
printf("Enter username: ");
unused << fgets(buf, sizeof(buf), stdin);
fgets(buf, sizeof(buf), stdin);
n = strlen(buf);
buf[n-1] = '\0'; // trim trailing newline
*user = NS_StringCloneData(NS_ConvertUTF8toUTF16(buf));
@ -828,7 +824,7 @@ nsresult LoadURLFromConsole()
{
char buffer[1024];
printf("Enter URL (\"q\" to start): ");
unused << scanf("%s", buffer);
scanf("%s", buffer);
if (buffer[0]=='q')
gAskUserForInput = false;
else

View File

@ -66,11 +66,9 @@
#include "keyt.h"
#include "ssl.h"
#include "plhash.h"
#include "mozilla/unused.h"
using std::string;
using std::vector;
using mozilla::unused;
#define IS_DELIM(m, c) ((m)[(c) >> 3] & (1 << ((c) & 7)))
#define SET_DELIM(m, c) ((m)[(c) >> 3] |= (1 << ((c) & 7)))
@ -1266,7 +1264,7 @@ int parseConfigFile(const char* filePath)
while (!feof(f))
{
char c;
unused << fscanf(f, "%c", &c);
fscanf(f, "%c", &c);
switch (c)
{
case '\n':

View File

@ -65,10 +65,6 @@
#include <stdio.h>
#endif
#include "mozilla/unused.h"
using mozilla::unused;
namespace mozilla {
namespace widget {
// the read end of the pipe, which will be used by GfxInfo
@ -94,8 +90,8 @@ static func_ptr_type cast(void *ptr)
static void fatal_error(const char *str)
{
unused << write(write_end_of_the_pipe, str, strlen(str));
unused << write(write_end_of_the_pipe, "\n", 1);
write(write_end_of_the_pipe, str, strlen(str));
write(write_end_of_the_pipe, "\n", 1);
exit(EXIT_FAILURE);
}
@ -109,7 +105,7 @@ x_error_handler(Display *, XErrorEvent *ev)
ev->error_code,
ev->request_code,
ev->minor_code);
unused << write(write_end_of_the_pipe, buf, length);
write(write_end_of_the_pipe, buf, length);
exit(EXIT_FAILURE);
return 0;
}
@ -257,7 +253,7 @@ static void glxtest()
dlclose(libgl);
///// Finally write data to the pipe
unused << write(write_end_of_the_pipe, buf, length);
write(write_end_of_the_pipe, buf, length);
}
/** \returns true in the child glxtest process, false in the parent process */

View File

@ -46,9 +46,6 @@
#include "prlog.h"
#include "prenv.h"
#include "mozilla/HangMonitor.h"
#include "mozilla/unused.h"
using mozilla::unused;
#define NOTIFY_TOKEN 0xFA
@ -79,7 +76,7 @@ nsAppShell::EventProcessorCallback(GIOChannel *source,
nsAppShell *self = static_cast<nsAppShell *>(data);
unsigned char c;
ssize_t ununsed = read(self->mPipeFDs[0], &c, 1);
read(self->mPipeFDs[0], &c, 1);
NS_ASSERTION(c == (unsigned char) NOTIFY_TOKEN, "wrong token");
self->NativeEventCallback();
@ -156,7 +153,7 @@ void
nsAppShell::ScheduleNativeEventCallback()
{
unsigned char buf[] = { NOTIFY_TOKEN };
unused << write(mPipeFDs[1], buf, 1);
write(mPipeFDs[1], buf, 1);
}
bool

View File

@ -46,9 +46,6 @@
#include "nsTHashtable.h"
#include "nsHashKeys.h"
#include <stdio.h>
#include "mozilla/unused.h"
using mozilla::unused;
namespace mozilla {
namespace MapsMemoryReporter {
@ -342,7 +339,7 @@ MapsReporter::ParseMapping(
devMinor, &inode, path);
// Eat up any whitespace at the end of this line, including the newline.
unused << fscanf(aFile, " ");
fscanf(aFile, " ");
// We might or might not have a path, but the rest of the arguments should be
// there.

View File

@ -1366,9 +1366,7 @@ public:
// Therefore we need to call the APIs directly.
GetTempPathA(mozilla::ArrayLength(basename), basename);
#else
char *tmp = tmpnam(basename);
if (!tmp)
return NS_ERROR_FAILURE;
tmpnam(basename);
char *lastSlash = strrchr(basename, XPCOM_FILE_PATH_SEPARATOR[0]);
if (lastSlash) {
*lastSlash = '\0';

View File

@ -47,7 +47,6 @@
#include "nsIObserverService.h"
#include "mozilla/HangMonitor.h"
#include "mozilla/Services.h"
#include "mozilla/unused.h"
#define HAVE_UALARM _BSD_SOURCE || (_XOPEN_SOURCE >= 500 || \
_XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED) && \
@ -73,7 +72,6 @@
#endif
using namespace mozilla;
using mozilla::unused;
#ifdef PR_LOGGING
static PRLogModuleInfo *sLog = PR_NewLogModule("nsThread");
@ -570,7 +568,7 @@ void canary_alarm_handler (int signum)
void *array[30];
const char msg[29] = "event took too long to run:\n";
// use write to be safe in the signal handler
unused << write(Canary::sOutputFD, msg, sizeof(msg));
write(Canary::sOutputFD, msg, sizeof(msg));
backtrace_symbols_fd(array, backtrace(array, 30), Canary::sOutputFD);
}