Fix build with Visual Studio 2015.

REVIEW: 128805
frameworks
Gleb Popov 10 years ago
parent 62f2cb99f6
commit bfa28f1f64
  1. 4
      autotests/mainshelltest.cpp
  2. 10
      ui/presentationwidget.cpp

@ -24,7 +24,11 @@
#include "../settings.h"
#include <sys/types.h>
#ifndef Q_OS_WIN
#include <unistd.h>
#else
#include <process.h>
#endif
namespace Okular {
class PartTest

@ -2147,8 +2147,13 @@ void PresentationWidget::initTransition( const Okular::PageTransition *transitio
// randomize the grid
for ( int i = 0; i < steps; i++ )
{
#ifndef Q_OS_WIN
int n1 = (int)(steps * drand48());
int n2 = (int)(steps * drand48());
#else
int n1 = (int)(steps * (std::rand() / RAND_MAX));
int n2 = (int)(steps * (std::rand() / RAND_MAX));
#endif
// swap items if index differs
if ( n1 != n2 )
{
@ -2238,8 +2243,13 @@ void PresentationWidget::initTransition( const Okular::PageTransition *transitio
int randomSteps = steps / 20;
for ( int i = 0; i < randomSteps; i++ )
{
#ifndef Q_OS_WIN
int n1 = (int)(steps * drand48());
int n2 = (int)(steps * drand48());
#else
int n1 = (int)(steps * (std::rand() / RAND_MAX));
int n2 = (int)(steps * (std::rand() / RAND_MAX));
#endif
// swap items if index differs
if ( n1 != n2 )
{

Loading…
Cancel
Save