To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.roboticsOpen lugnet.robotics in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / 3743
3742  |  3744
Subject: 
Re: legOS development release imminent / C++
Newsgroups: 
lugnet.robotics
Date: 
Sun, 14 Feb 1999 16:20:49 GMT
Original-From: 
Ben Laurie <ben@algroup.*StopSpammers*co.uk>
Viewed: 
1634 times
  
Markus L. Noga wrote:
I'm worried about compactness with C++ in general. The code generated by
this function is 76 bytes long:

void do_sensing_c() {
  int i;
  ds_active(&SENSOR_1);

  for(i=0; i<100; i++) {
    cputw(SENSOR_1);
    lcd_refresh();
    delay(20);
  }
  ds_passive(&SENSOR_1);
}

The exact same thing in C++ generates 232 bytes:

void do_sensing_cpp() {
  Sensor s(Sensor::s1,1);

  for(int i=0; i<100; i++) {
    cputw(s.value());
    lcd_refresh();
    delay(20);
  }
}

A factor of three. I'm not sure whether it's worth treading this path.

These don't look exactly the same to me, but without the definition of
Sensor, its hard to say...

Cheers,

Ben.

--
http://www.apache-ssl.org/ben.html

"My grandfather once told me that there are two kinds of people: those
who work and those who take the credit. He told me to try to be in the
first group; there was less competition there."
     - Indira Gandhi
--
Did you check the web site first?: http://www.crynwr.com/lego-robotics



Message is in Reply To:
  legOS development release imminent / C++
 
Hello everyone, there'll be a new development release shortly. This will probably be less stable than 0.1.6. I've been working on and integrating contributions for many different features: - automatic generation of API documentation with doxygen - (...) (26 years ago, 14-Feb-99, to lugnet.robotics)

2 Messages in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR